Repository navigation
feat: add threads and session_options to Stackvox - #66
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #61, the other half of it. #65 is the streaming generator.
Stackvox.__init__builtKokoro(model, voices)and left ONNX Runtime to size its thread pools from the host core count, which is wrong inside a container with a CPU quota - more threads fighting over less CPU than the default assumed.threads=caps both pools,session_options=hands over the whole SessionOptions for anything else. They're mutually exclusive and it errors if you pass both.On this box (12 cores) default construction adds 5 OS threads and
threads=2adds 1. Audio out is identical either way.The fiddly bit is providers.
Kokoro.from_sessiontakes the session exactly as handed to it, so building one ourselves means making the provider choiceKokoro.__init__would have made, otherwise asking for a thread cap quietly changes which provider runs the model. Mirrored theONNX_PROVIDERenv var and the CPU default. Didn't mirror their GPU probe, it'sfind_spec("onnxruntime-gpu")on a distribution name that isn't an importable module, so that branch has never fired.onnxruntimeis a direct dependency now. It was already arriving via kokoro-onnx but it's in the public signature so it should be declared.6 new tests.