Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ cancel_encode = False
|
|
26 |
cancel_decode = False
|
27 |
cancel_stream = False
|
28 |
|
29 |
-
@spaces.GPU(duration=
|
30 |
def encode_audio(filepath):
|
31 |
"""Encode and decode audio file"""
|
32 |
try:
|
@@ -49,7 +49,7 @@ def handle_encode_output(file_path):
|
|
49 |
return None, gr.Markdown("Encoding failed. Please ensure you've uploaded an audio file and try again.", visible=True)
|
50 |
return file_path, gr.Markdown(visible=False)
|
51 |
|
52 |
-
@spaces.GPU(duration=
|
53 |
def decode_audio(encoded_file='encoded.pkl'):
|
54 |
"""Decode tokens back to audio"""
|
55 |
try:
|
@@ -76,7 +76,7 @@ def decode_audio(encoded_file='encoded.pkl'):
|
|
76 |
traceback.print_exc()
|
77 |
return None
|
78 |
|
79 |
-
@spaces.GPU(duration=
|
80 |
async def stream_decode_audio(encoded_file_path) -> Generator[tuple, None, None]:
|
81 |
global cancel_stream
|
82 |
|
|
|
26 |
cancel_decode = False
|
27 |
cancel_stream = False
|
28 |
|
29 |
+
@spaces.GPU(duration=75)
|
30 |
def encode_audio(filepath):
|
31 |
"""Encode and decode audio file"""
|
32 |
try:
|
|
|
49 |
return None, gr.Markdown("Encoding failed. Please ensure you've uploaded an audio file and try again.", visible=True)
|
50 |
return file_path, gr.Markdown(visible=False)
|
51 |
|
52 |
+
@spaces.GPU(duration=75)
|
53 |
def decode_audio(encoded_file='encoded.pkl'):
|
54 |
"""Decode tokens back to audio"""
|
55 |
try:
|
|
|
76 |
traceback.print_exc()
|
77 |
return None
|
78 |
|
79 |
+
@spaces.GPU(duration=75)
|
80 |
async def stream_decode_audio(encoded_file_path) -> Generator[tuple, None, None]:
|
81 |
global cancel_stream
|
82 |
|