Skip to content

fix(sherpaonnx): accept numeric values in credentials JSON - #13

Merged
willwade merged 2 commits into
mainfrom
fix/sherpa-creds-numeric-values
Aug 16, 2026
Merged

fix(sherpaonnx): accept numeric values in credentials JSON#13
willwade merged 2 commits into
mainfrom
fix/sherpa-creds-numeric-values

Conversation

@willwade

Copy link
Copy Markdown
Contributor

Why

A strict HashMap<String, String> parse silently discards the entire credentials object when any value is a JSON number. {"modelId": "kokoro-en-v0_19", "numThreads": 2} therefore came up with no model at all — no error, just a later 'no modelId configured' failure that looks unrelated. VoiceGarden-SPD shipped numThreads as a number and hit exactly this.

What

Parse as HashMap<String, Value> and coerce numbers to their string form (booleans/null keep their JSON text — callers don't use them today). String values pass through unchanged.

Testing

New unit test constructs an engine with numeric numThreads/numSteps and asserts both take effect.

The strict HashMap<String, String> parse silently discarded the entire
credentials object when any value was a JSON number (e.g.
{"numThreads": 2}), leaving every option at its default with no
error — VoiceGarden-SPD hit this shipping numThreads as a number.
Coerce numbers to their string form instead.
@willwade
willwade merged commit fb06fb2 into main Aug 16, 2026
12 checks passed
@willwade
willwade deleted the fix/sherpa-creds-numeric-values branch August 16, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant