Spaces:
Sleeping
Sleeping
Add dummy batch for model warmup in svs_warmup function
Browse files- requirements.txt +2 -0
- svs_utils.py +15 -0
requirements.txt
CHANGED
|
@@ -11,4 +11,6 @@ fugashi
|
|
| 11 |
pykakasi
|
| 12 |
basic-pitch[onnx]
|
| 13 |
audiobox_aesthetics
|
|
|
|
|
|
|
| 14 |
git+https://github.com/sea-turt1e/kanjiconv
|
|
|
|
| 11 |
pykakasi
|
| 12 |
basic-pitch[onnx]
|
| 13 |
audiobox_aesthetics
|
| 14 |
+
transformers
|
| 15 |
+
s3prl
|
| 16 |
git+https://github.com/sea-turt1e/kanjiconv
|
svs_utils.py
CHANGED
|
@@ -28,6 +28,21 @@ def svs_warmup(config):
|
|
| 28 |
model_file=downloaded["model_file"],
|
| 29 |
device=config.device,
|
| 30 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
else:
|
| 32 |
raise NotImplementedError(f"Model {config.model_path} not supported")
|
| 33 |
return model
|
|
|
|
| 28 |
model_file=downloaded["model_file"],
|
| 29 |
device=config.device,
|
| 30 |
)
|
| 31 |
+
dummy_batch = {
|
| 32 |
+
"score": (
|
| 33 |
+
75, # tempo
|
| 34 |
+
[
|
| 35 |
+
(0.0, 0.25, "r_en", 63.0, "r_en"),
|
| 36 |
+
(0.25, 0.5, "—", 63.0, "en"),
|
| 37 |
+
],
|
| 38 |
+
),
|
| 39 |
+
"text": "r en en",
|
| 40 |
+
}
|
| 41 |
+
model(
|
| 42 |
+
dummy_batch,
|
| 43 |
+
lids=np.array([2]),
|
| 44 |
+
spembs=np.load("resource/singer/singer_embedding_ace-2.npy"),
|
| 45 |
+
) # warmup
|
| 46 |
else:
|
| 47 |
raise NotImplementedError(f"Model {config.model_path} not supported")
|
| 48 |
return model
|