firstbatchxyz / dkn-compute-node

Compute Node of Dria Knowledge Network.
Apache License 2.0
8 stars 2 forks source link

Cancellation of Ollama generation #18

Open erhant opened 1 month ago

erhant commented 1 month ago

We should add a tokio::select! right at https://github.com/firstbatchxyz/dkn-compute-node/blob/master/src/compute/ollama.rs#L117 so that if the process is terminated while a search is going on, it should cancel that call and return gracefully.

If Ollama is running on container & is killed anyways, it will terminate with code 500, but we could be more graceful this way.

Our Ollama wrapper should take the token in the struct itself, and this token should be used in setup as well.