Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run the quantized version of kokoro using the Python API, an error occurred. #1923

Open
guoguo1314 opened this issue Feb 26, 2025 · 5 comments

Comments

@guoguo1314
Copy link

guoguo1314 commented Feb 26, 2025

the quantized of kokoro is here: https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX/blob/main/onnx/model_quantized.onnx

the sherpa-onnx as follow:
sherpa-onnx 1.10.45

use the command:

python sherpa-onnx/python-api-examples/offline-tts-play.py \
  --kokoro-model onnx-community/Kokoro-82M-v1.0-ONNX/onnx/model_quantized.onnx \
  --kokoro-tokens onnx-community/Kokoro-82M-v1.0-ONNX/tokens.txt \
  --kokoro-data-dir=onnx-community/Kokoro-82M-v1.0-ONNX/espeak-ng-data \
  --kokoro-dict-dir=onnx-community/Kokoro-82M-v1.0-ONNX/dict \
  --kokoro-lexicon=onnx-community/Kokoro-82M-v1.0-ONNX/lexicon-us-en.txt,onnx-community/Kokoro-82M-v1.0-ONNX/lexicon-zh.txt \
  --output-filename test.wav \
  --sid 0 \
  --speed 1.0 \
  --provider cpu \
  "今天天气真不错"

it cause the error as follow:
2025-02-26 14:00:50,567 INFO [offline-tts-play.py:513] Loading model ... Traceback (most recent call last): File "/home/lyg/Codes/sherpa-onnx/python-api-examples/offline-tts-play.py", line 576, in <module> main() File "/home/lyg/Codes/sherpa-onnx/python-api-examples/offline-tts-play.py", line 514, in main tts = sherpa_onnx.OfflineTts(tts_config) RuntimeError: Failed to load model with error: /shared/onnxruntime/core/graph/model_load_utils.h:46 void onnxruntime::model_load_utils::ValidateOpsetForDomain(const std::unordered_map<std::basic_string<char>, int>&, const onnxruntime::logging::Logger&, bool, const string&, int) ONNX Runtime only *guarantees* support for models stamped with official released onnx opset versions. Opset 5 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx.ml is till opset 4.

thank you!

@csukuangfj
Copy link
Collaborator

please follow
#1719

to update the onnxruntime in sherpa-onnx. currently, we use onnxruntime 1.17.1

@guoguo1314
Copy link
Author

guoguo1314 commented Feb 26, 2025

when I update the onnxruntime, the error also exist.
Please note that, apart from the model_quantized.onnx file, the tokens.txt, espeak-ng-data, dict, lexicon-us-en.txt, and lexicon-zh.txt files were all copied from the sherpa-onnx's kokoro-multi-lang-v1_0.tar.bz2 archive https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2

@csukuangfj
Copy link
Collaborator

when I update the onnxruntime,

which version of onnxruntime are you using? please also describe how you update it.

@guoguo1314
Copy link
Author

guoguo1314 commented Feb 26, 2025

Image
1.17.1,
pip install onnxruntime==1.17.1dirctly

@csukuangfj
Copy link
Collaborator

I hope you follow my first comment to update onnxruntime in sherpa-onnx.

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

No branches or pull requests

2 participants