Add function for stopping inference

This commit is contained in:
Kevin Ladan 2024-10-09 12:33:19 +08:00
parent 6b094b72d3
commit ec4ece8523

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 {