Add function for stopping inference (#224)

This commit is contained in:
kebbbnnn 2024-10-09 22:50:19 +08:00 committed by GitHub
parent 6b094b72d3
commit 0f66ae0f61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,10 @@ public class LocalInference: Inference {
}
}
public func stop() {
runnerHolder.runner?.stop()
}
public func chatCompletion(request: Components.Schemas.ChatCompletionRequest) -> AsyncStream<Components.Schemas.ChatCompletionResponseStreamChunk> {
return AsyncStream { continuation in
runnerQueue.async {