facebookresearch / seamless_communication

Foundational Models for State-of-the-Art Speech and Text Translation
Other
10.53k stars 1.02k forks source link

Question about weight file save path #114

Closed namho-96 closed 10 months ago

namho-96 commented 10 months ago

Hello. Thanks for sharing your great research! I have a question about the process of loading a model. In my Ubuntu environment, when I load a model with the following code, the model is stored in ".cache/torch/hub".

import torch
import torchaudio
from seamless_communication.models.inference import Translator

# Initialize a Translator object with a multitask model, vocoder on the GPU.
translator = Translator("seamlessM4T_large", "vocoder_36langs", torch.device("cuda:0"), torch.float16)

I would like to replace this path with a different path and load the model from the changed path. I would be grateful if you could tell me how this is possible.

zachNA2 commented 10 months ago

You have two options for this. Either you change the path in the asset card so instead of pulling from https://whateverLink it will pull from file://Whatever/your/path/is.

Second option is just moving the model weights into the ~/.cache folder.

Both are mentioned in #50