Spaces:
Runtime error
Runtime error
xJuuzouYTx
commited on
Commit
•
46a6192
1
Parent(s):
9db2503
[ADD] error messages
Browse files- app.py +1 -1
- models/model.py +10 -2
app.py
CHANGED
@@ -48,7 +48,7 @@ with gr.Blocks() as app:
|
|
48 |
|
49 |
gr.HTML("<h4> El espacio actual usa solo cpu, así que es solo para inferencia. Se recomienda duplicar el espacio para no tener problemas con las colas de procesamiento. </h4>")
|
50 |
|
51 |
-
gr.Markdown("[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/drive/1NKqqTR04HujeBxzwe7jbYEvNi8LbxD_N?usp=sharing)")
|
52 |
gr.Markdown(
|
53 |
"[![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-sm-dark.svg)](https://huggingface.co/spaces/juuxn/SimpleRVC?duplicate=true)\n\n"
|
54 |
)
|
|
|
48 |
|
49 |
gr.HTML("<h4> El espacio actual usa solo cpu, así que es solo para inferencia. Se recomienda duplicar el espacio para no tener problemas con las colas de procesamiento. </h4>")
|
50 |
|
51 |
+
gr.Markdown("Simple RVC GPU Inference on colab: [![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/drive/1NKqqTR04HujeBxzwe7jbYEvNi8LbxD_N?usp=sharing)")
|
52 |
gr.Markdown(
|
53 |
"[![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-sm-dark.svg)](https://huggingface.co/spaces/juuxn/SimpleRVC?duplicate=true)\n\n"
|
54 |
)
|
models/model.py
CHANGED
@@ -66,7 +66,14 @@ def compress(modelname, files):
|
|
66 |
return file_path
|
67 |
|
68 |
def infer(model, f0_method, audio_file, index_rate, vc_transform0, protect0, resample_sr1, filter_radius1):
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
inference = Inference(
|
71 |
model_name=model,
|
72 |
f0_method=f0_method,
|
@@ -80,11 +87,12 @@ def infer(model, f0_method, audio_file, index_rate, vc_transform0, protect0, res
|
|
80 |
)
|
81 |
output = inference.run()
|
82 |
if 'success' in output and output['success']:
|
|
|
83 |
return output, output['file']
|
84 |
else:
|
|
|
85 |
return "Failed", None
|
86 |
|
87 |
-
|
88 |
def post_model(name, model_url, version, creator):
|
89 |
modelname = model_downloader(model_url, zips_folder, unzips_folder)
|
90 |
model_files = get_model(unzips_folder, modelname)
|
|
|
66 |
return file_path
|
67 |
|
68 |
def infer(model, f0_method, audio_file, index_rate, vc_transform0, protect0, resample_sr1, filter_radius1):
|
69 |
+
|
70 |
+
if not model:
|
71 |
+
return "No model url specified, please specify a model url.", None
|
72 |
+
|
73 |
+
if not audio_file:
|
74 |
+
return "No audio file specified, please load an audio file.", None
|
75 |
+
|
76 |
+
|
77 |
inference = Inference(
|
78 |
model_name=model,
|
79 |
f0_method=f0_method,
|
|
|
87 |
)
|
88 |
output = inference.run()
|
89 |
if 'success' in output and output['success']:
|
90 |
+
print("Inferencia realizada exitosamente...")
|
91 |
return output, output['file']
|
92 |
else:
|
93 |
+
print("Fallo en la inferencia...", output)
|
94 |
return "Failed", None
|
95 |
|
|
|
96 |
def post_model(name, model_url, version, creator):
|
97 |
modelname = model_downloader(model_url, zips_folder, unzips_folder)
|
98 |
model_files = get_model(unzips_folder, modelname)
|