mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-09-29 00:30:15 +08:00
utility updates
This commit is contained in:
parent
48d52778ce
commit
72c5d3224e
2
.gitignore
vendored
2
.gitignore
vendored
@ -194,7 +194,9 @@ cython_debug/
|
||||
# PyPI configuration file
|
||||
.pypirc
|
||||
|
||||
#onnx
|
||||
onnx/
|
||||
*.onnx
|
||||
tokenizer.json
|
||||
output.wav
|
||||
config.json
|
@ -87,6 +87,25 @@ def export_bert_to_onnx(
|
||||
else:
|
||||
print("Warning: tokenizer.json not found")
|
||||
|
||||
# Copy config.json if it exists
|
||||
if tokenizer_cache_dir and os.path.isdir(tokenizer_cache_dir):
|
||||
config_json_path = os.path.join(tokenizer_cache_dir, "config.json")
|
||||
else:
|
||||
# For models from HuggingFace cache
|
||||
cache_dir = os.path.expanduser("~/.cache/huggingface/transformers")
|
||||
config_json_path = None
|
||||
for root, dirs, files in os.walk(cache_dir):
|
||||
if "config.json" in files and model_name.replace("/", "--") in root:
|
||||
config_json_path = os.path.join(root, "config.json")
|
||||
break
|
||||
|
||||
if config_json_path and os.path.exists(config_json_path):
|
||||
dest_config_path = os.path.join(output_dir, "config.json")
|
||||
shutil.copy2(config_json_path, dest_config_path)
|
||||
print(f"Copied config.json to: {dest_config_path}")
|
||||
else:
|
||||
print("Warning: config.json not found")
|
||||
|
||||
print(f"Model exported successfully to: {output_dir}")
|
||||
return combined_model, onnx_path
|
||||
|
||||
|
@ -11,6 +11,7 @@ onnx
|
||||
onnxruntime; platform_machine == "aarch64" or platform_machine == "arm64"
|
||||
onnxruntime-gpu; platform_machine == "x86_64" or platform_machine == "AMD64"
|
||||
onnxsim
|
||||
onnxruntime-tools
|
||||
tqdm
|
||||
funasr==1.0.27
|
||||
cn2an
|
||||
|
Loading…
x
Reference in New Issue
Block a user