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 #144

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

BBC-Esq
Copy link
Contributor

@BBC-Esq BBC-Esq commented Jun 18, 2024

The goal is to be able to specify the base directory in which all files downloaded from huggingface are downloaded instead of the default cache directory.

Some sample code might look like this:

from pathlib import Path

current_directory = Path(__file__).parent
CACHE_DIR = current_directory / "models" / "tts"
CACHE_DIR.mkdir(parents=True, exist_ok=True)

class BaseAudio:
.
.
.

class WhisperSpeechAudio(BaseAudio):
    def __init__(self):
        super().__init__()
        self.initialize_model()

    def initialize_model(self):

        self.pipe = Pipeline(
            s2a_ref='collabora/whisperspeech:s2a-q4-base-en+pl.model',
            t2s_ref='collabora/whisperspeech:t2s-base-en+pl.model',
            cache_dir=CACHE_DIR
        )
.
.
.

expose "cache_dir" parameter from hf_hub_download in order to specify where stuff is downloaded to
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
expose "cache_dir" parameter
I had to delete this to get it to work on my system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant