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

Add scripts to support onnx export #622

Merged
merged 10 commits into from
Jul 29, 2024
17 changes: 17 additions & 0 deletions onnx_export/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Export onnx models for deployment

## Export GPT
1. Downgrade the transformers package to v4.32.
- `pip install transformers==4.32`
- remove `from transformers.cache_utils import Cache` in `./ChatTTS/model/gpt.py`

2. Replace `modeling_llama.py` with `./onnx_export/assets/modeling_llama.py`.
ZillaRU marked this conversation as resolved.
Show resolved Hide resolved
Run `pip show transformers` to get the path to the transformers package, and run `cp ./onnx_export/assets/modeling_llama.py [path_to_transformers]/src/transformers/models/llama/modeling_llama.py`.

3. Run `trace_gpt.py`

## Export other models
Run `trace_others.py`

## Reference
[Run LLMs on Sophon TPU](https://github.com/sophgo/LLM-TPU)
Loading
Loading