Repository navigation
fix(tiny_voca): keep graphs in a bounded session cache and refuse languages other than English - #1324
Merged
Merged
Conversation
A request option language=ja was ignored and the text was read as English (HTTP 200 from the server). A language given with the text was refused, but as a server error (HTTP 500). Both places are now checked. English (en, en-us, English) and no language are accepted; anything else is an InvalidRequestError, so the command-line tool fails with a clear message and the server answers HTTP 400. The rule is covered in tiny_voca_unit_test without model files, and language_test.py checks the real command-line tool and server.
The three transformer graphs were built again for every sentence. The session's runtime now keeps the graphs it used last in a cache built on runtime::CacheSlots and runs a kept graph again when the same stack meets the same length. The cache holds 6 graphs and 4 MB of buffers at most, least recently used first out. The size limit is there because a graph grows with its length, from about 0.3 MB to about 25 MB at the model's limit; a graph over the limit is freed after its sentence as before. With logging on, tiny_voca.<stack>_graph.cache_hit shows each reuse. The audio does not change: the 700 comparison utterances are byte-identical.
Owner
|
@n4ze3m PR merged. Thanks! |
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.
Follow-up to #1311 for the two points from the review