Hareesh Polla commited on
Commit ·
33bebbd
1
Parent(s): 28093f4
adjust ckpt_path param
Browse files- config.json +1 -1
- model.py +7 -3
config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"AutoConfig": "model.INF5Config",
|
| 5 |
"AutoModel": "model.INF5Model"
|
| 6 |
},
|
| 7 |
-
"ckpt_path": "
|
| 8 |
"model_type": "inf5",
|
| 9 |
"remove_sil": true,
|
| 10 |
"speed": 1.0,
|
|
|
|
| 4 |
"AutoConfig": "model.INF5Config",
|
| 5 |
"AutoModel": "model.INF5Model"
|
| 6 |
},
|
| 7 |
+
"ckpt_path": "",
|
| 8 |
"model_type": "inf5",
|
| 9 |
"remove_sil": true,
|
| 10 |
"speed": 1.0,
|
model.py
CHANGED
|
@@ -24,7 +24,10 @@ import os
|
|
| 24 |
class INF5Config(PretrainedConfig):
|
| 25 |
model_type = "inf5"
|
| 26 |
|
| 27 |
-
def __init__(self,
|
|
|
|
|
|
|
|
|
|
| 28 |
speed: float = 1.0, remove_sil: bool = True, device: str = "", **kwargs):
|
| 29 |
super().__init__(**kwargs)
|
| 30 |
self.ckpt_path = ckpt_path
|
|
@@ -54,6 +57,7 @@ class INF5Model(PreTrainedModel):
|
|
| 54 |
self.ema_model = torch.compile(load_model(
|
| 55 |
DiT,
|
| 56 |
dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4),
|
|
|
|
| 57 |
mel_spec_type="vocos",
|
| 58 |
vocab_file=vocab_path,
|
| 59 |
device=self._device
|
|
@@ -148,12 +152,12 @@ if __name__ == '__main__':
|
|
| 148 |
|
| 149 |
from huggingface_hub import HfApi
|
| 150 |
|
| 151 |
-
repo_id = "
|
| 152 |
|
| 153 |
# Upload model directory to HF
|
| 154 |
api = HfApi()
|
| 155 |
api.upload_folder(
|
| 156 |
-
folder_path="INF5",
|
| 157 |
repo_id=repo_id,
|
| 158 |
repo_type="model"
|
| 159 |
)
|
|
|
|
| 24 |
class INF5Config(PretrainedConfig):
|
| 25 |
model_type = "inf5"
|
| 26 |
|
| 27 |
+
def __init__(self,
|
| 28 |
+
ckpt_path: str = "",
|
| 29 |
+
# ckpt_path: str = "checkpoints/model_best.pt",
|
| 30 |
+
vocab_path: str = "checkpoints/vocab.txt",
|
| 31 |
speed: float = 1.0, remove_sil: bool = True, device: str = "", **kwargs):
|
| 32 |
super().__init__(**kwargs)
|
| 33 |
self.ckpt_path = ckpt_path
|
|
|
|
| 57 |
self.ema_model = torch.compile(load_model(
|
| 58 |
DiT,
|
| 59 |
dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4),
|
| 60 |
+
config.ckpt_path,
|
| 61 |
mel_spec_type="vocos",
|
| 62 |
vocab_file=vocab_path,
|
| 63 |
device=self._device
|
|
|
|
| 152 |
|
| 153 |
from huggingface_hub import HfApi
|
| 154 |
|
| 155 |
+
repo_id = "hareeshbabu82/TeluguIndicF5" # Change to your HF repo
|
| 156 |
|
| 157 |
# Upload model directory to HF
|
| 158 |
api = HfApi()
|
| 159 |
api.upload_folder(
|
| 160 |
+
# folder_path="INF5",
|
| 161 |
repo_id=repo_id,
|
| 162 |
repo_type="model"
|
| 163 |
)
|