Spaces:
Build error
Build error
no comment
Browse files
__pycache__/inference_main.cpython-38.pyc
CHANGED
Binary files a/__pycache__/inference_main.cpython-38.pyc and b/__pycache__/inference_main.cpython-38.pyc differ
|
|
__pycache__/utils.cpython-38.pyc
CHANGED
Binary files a/__pycache__/utils.cpython-38.pyc and b/__pycache__/utils.cpython-38.pyc differ
|
|
app.py
CHANGED
@@ -1,10 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
from inference_main import infer
|
|
|
3 |
def interference(wav_file, trans=0):
|
4 |
# determine if wav_file is .wav
|
5 |
# then, inference
|
6 |
# return the result
|
7 |
# if the wav_file is not .wav, inform the user and let user re upload the file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
if not wav_file.endswith('.wav'):
|
9 |
return None, "Please upload a .wav file"
|
10 |
return infer(wav_file, trans=[trans]), "Succeed"
|
|
|
1 |
import gradio as gr
|
2 |
from inference_main import infer
|
3 |
+
import wave
|
4 |
def interference(wav_file, trans=0):
|
5 |
# determine if wav_file is .wav
|
6 |
# then, inference
|
7 |
# return the result
|
8 |
# if the wav_file is not .wav, inform the user and let user re upload the file
|
9 |
+
|
10 |
+
# ME:
|
11 |
+
# if wav_file length > 30s or < 1s, inform the user and let user re upload the file
|
12 |
+
f = wave.open(wav_file, 'rb')
|
13 |
+
time_count = f.getnframes() / f.getframerate()
|
14 |
+
if time_count > 30 or time_count < 1:
|
15 |
+
return None, "Please upload a .wav file with length between 1s and 30s"
|
16 |
if not wav_file.endswith('.wav'):
|
17 |
return None, "Please upload a .wav file"
|
18 |
return infer(wav_file, trans=[trans]), "Succeed"
|
results/自己唱的22768bc9e21891ae91a6543283be1b3e614da1d5-0-100_tokaiteio_13.0key.flac
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:25c38a8fa2d21362fa331b09fb827230819e96483af3a7e305f68450569c9428
|
3 |
+
size 1234204
|
test.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def welcome(name):
|
4 |
-
return f"Welcome to Gradio, {name}!"
|
5 |
-
|
6 |
-
with gr.Blocks() as demo:
|
7 |
-
gr.Markdown(
|
8 |
-
"""
|
9 |
-
# Hello World!
|
10 |
-
Start typing below to see the output.
|
11 |
-
""")
|
12 |
-
inp = gr.Textbox(placeholder="What is your name?")
|
13 |
-
out = gr.Textbox()
|
14 |
-
inp.change(welcome, inp, out)
|
15 |
-
|
16 |
-
if __name__ == "__main__":
|
17 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
utils.py
CHANGED
@@ -262,7 +262,7 @@ def save_checkpoint(model, optimizer, learning_rate, iteration, checkpoint_path)
|
|
262 |
'optimizer': optimizer.state_dict(),
|
263 |
'learning_rate': learning_rate}, checkpoint_path)
|
264 |
|
265 |
-
def clean_checkpoints(path_to_models='
|
266 |
"""Freeing up space by deleting saved ckpts
|
267 |
|
268 |
Arguments:
|
|
|
262 |
'optimizer': optimizer.state_dict(),
|
263 |
'learning_rate': learning_rate}, checkpoint_path)
|
264 |
|
265 |
+
def clean_checkpoints(path_to_models='vdecoder/hifigan-a/', n_ckpts_to_keep=2, sort_by_time=True):
|
266 |
"""Freeing up space by deleting saved ckpts
|
267 |
|
268 |
Arguments:
|