3 ms·
Hi, I haven't tried this myself, but it seems there's a way? https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md#api-endpoints https://
by exe34 3y ago
Hi, I haven't tried this myself, but it seems there's a way?
https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md#api-endpoints https://github.com/ggerganov/llama.cpp/blob/master/examples/...
The call takes a "stream" boolean:
stream: It allows receiving each predicted token in real-time instead of waiting for the completion to finish. To enable this, set to true.
And the response includes:
stop: Boolean for use with stream to check whether the generation has stopped (Note: This is not related to stopping words array stop from input options)
Certainly the local web interface has a stop button, and I'm pretty sure that one did work.
But maybe I'm misunderstanding the challenge here?
- tarruda 3y agoYou're right, llama-cpp-python OpenAI compatible endpoint works with `stream:true` and you can interrupt generation anytime by simply closing the connection. I use this in a private fork of Chatbot-UI, and it just works.