update
Browse files
model.py
CHANGED
|
@@ -43,9 +43,9 @@ class INF5Model(PreTrainedModel):
|
|
| 43 |
self.vocoder = torch.compile(load_vocoder(vocoder_name="vocos", is_local=False, device=device))
|
| 44 |
|
| 45 |
# Download and load model weights
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
# Download vocab.txt from HF Hub
|
| 51 |
vocab_path = hf_hub_download(config.name_or_path, filename="checkpoints/vocab.txt")
|
|
|
|
| 43 |
self.vocoder = torch.compile(load_vocoder(vocoder_name="vocos", is_local=False, device=device))
|
| 44 |
|
| 45 |
# Download and load model weights
|
| 46 |
+
safetensors_path = hf_hub_download(config.name_or_path, filename="model.safetensors")
|
| 47 |
+
print(f"Loading model weights from {safetensors_path} (safetensors)...")
|
| 48 |
+
state_dict = load_file(safetensors_path, device=str(device))
|
| 49 |
|
| 50 |
# Download vocab.txt from HF Hub
|
| 51 |
vocab_path = hf_hub_download(config.name_or_path, filename="checkpoints/vocab.txt")
|