Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama authored Jan 7, 2025
1 parent fa21047 commit 647133f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ChatTTS/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,13 @@ def download_models(
)
return None
elif source == "huggingface":
if cache_dir is None:
hf_home = os.getenv(
"HF_HOME", os.path.expanduser("~/.cache/huggingface")
)
else:
hf_home = cache_dir
try:
download_path = get_latest_modified_file(
os.path.join(hf_home, "hub/models--2Noise--ChatTTS/snapshots")
os.path.join(os.getenv(
"HF_HOME", os.path.expanduser("~/.cache/huggingface")
), "hub/models--2Noise--ChatTTS/snapshots")
) if cache_dir is None else get_latest_modified_file(
os.path.join(cache_dir, "models--2Noise--ChatTTS/snapshots")
)
except:
download_path = None
Expand Down

0 comments on commit 647133f

Please sign in to comment.