Export Kokoro 1.0 to sherpa-onnx (#1788)
This commit is contained in:
19
scripts/kokoro/v1.0/generate_tokens.py
Executable file
19
scripts/kokoro/v1.0/generate_tokens.py
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2025 Xiaomi Corp. (authors: Fangjun Kuang)
|
||||
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def main():
|
||||
with open("config.json") as f:
|
||||
config = json.load(f)
|
||||
vocab = config["vocab"]
|
||||
|
||||
with open("tokens.txt", "w", encoding="utf-8") as f:
|
||||
for k, i in vocab.items():
|
||||
f.write(f"{k} {i}\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user