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 cache_dir parameter #863

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

BBC-Esq
Copy link

@BBC-Esq BBC-Esq commented Dec 31, 2024

Currently, it's the program only allows you to use "huggingface," "local," or "custom" but none allow you to specify a directory where you want to download a file automatically using ```snapshot_download." This fixes that.

This pull request implements the following:

Here's a brief summary of the different options for handling model files in ChatTTS:

source="huggingface": Downloads models from HuggingFace repo to ~/.cache/huggingface

  • or to cache_dir if specified

source="local": Downloads models from HuggingFace repo to current working directory

  • or to cache_dir if specified

source="custom":

  • No change

Example Usage:

from ChatTTS import Chat

# Option 1: Using huggingface source with custom cache directory
chat = Chat()
chat.load(
    source="huggingface",
    cache_dir="path/to/your/models",
    device="cuda"
)

# Option 2: Using local source with custom cache directory 
chat = Chat()
chat.load(
    source="local",
    cache_dir="path/to/your/models",
    device="cuda"
)

# Original behavior still works without cache_dir
chat = Chat()
chat.load(
    source="huggingface",  # Will use ~/.cache/huggingface
    device="cuda"
)

@github-actions github-actions bot changed the base branch from main to dev December 31, 2024 02:15
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

Successfully merging this pull request may close these issues.

1 participant