Spaces:
Paused
Paused
Commit
·
6db8e8a
1
Parent(s):
0293e4c
feat: change model name
Browse files- app/export.py +1 -3
- app/infer.py +1 -2
app/export.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from glob import glob
|
| 2 |
import os
|
| 3 |
import shutil
|
| 4 |
-
import tempfile
|
| 5 |
import gradio as gr
|
| 6 |
from infer.lib.train.process_ckpt import extract_small_model
|
| 7 |
from app.train import train_index
|
|
@@ -15,8 +14,7 @@ def download_weight(exp_dir: str) -> str:
|
|
| 15 |
latest_checkpoint = max(checkpoints, key=os.path.getctime)
|
| 16 |
print(f"Latest checkpoint: {latest_checkpoint}")
|
| 17 |
|
| 18 |
-
|
| 19 |
-
out = os.path.join(exp_dir, f"{name}.pth")
|
| 20 |
extract_small_model(
|
| 21 |
latest_checkpoint, out, "40k", True, "Model trained by ZeroGPU.", "v2"
|
| 22 |
)
|
|
|
|
| 1 |
from glob import glob
|
| 2 |
import os
|
| 3 |
import shutil
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from infer.lib.train.process_ckpt import extract_small_model
|
| 6 |
from app.train import train_index
|
|
|
|
| 14 |
latest_checkpoint = max(checkpoints, key=os.path.getctime)
|
| 15 |
print(f"Latest checkpoint: {latest_checkpoint}")
|
| 16 |
|
| 17 |
+
out = os.path.join(exp_dir, f"model.pth")
|
|
|
|
| 18 |
extract_small_model(
|
| 19 |
latest_checkpoint, out, "40k", True, "Model trained by ZeroGPU.", "v2"
|
| 20 |
)
|
app/infer.py
CHANGED
|
@@ -15,8 +15,7 @@ from model import device
|
|
| 15 |
def infer(
|
| 16 |
exp_dir: str, original_audio: str, f0add: int, index_rate: float, protect: float
|
| 17 |
) -> Tuple[int, np.ndarray]:
|
| 18 |
-
|
| 19 |
-
model = os.path.join(exp_dir, f"{name}.pth")
|
| 20 |
if not os.path.exists(model):
|
| 21 |
raise gr.Error("Model not found")
|
| 22 |
|
|
|
|
| 15 |
def infer(
|
| 16 |
exp_dir: str, original_audio: str, f0add: int, index_rate: float, protect: float
|
| 17 |
) -> Tuple[int, np.ndarray]:
|
| 18 |
+
model = os.path.join(exp_dir, "model.pth")
|
|
|
|
| 19 |
if not os.path.exists(model):
|
| 20 |
raise gr.Error("Model not found")
|
| 21 |
|