Spaces:
Runtime error
Runtime error
agorlanov
commited on
Commit
•
11111a6
1
Parent(s):
d172563
add login
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
from main_pipeline import main_pipeline
|
@@ -5,7 +7,6 @@ from scipy.io.wavfile import write
|
|
5 |
|
6 |
url = "https://t.me/diarizarion_bot"
|
7 |
|
8 |
-
|
9 |
title = "Audio_denoise and speaker diarization.Faster inference <a href='{}' target='_blank'>tg_bot</a>".format(url)
|
10 |
|
11 |
example_list = [
|
@@ -21,7 +22,7 @@ def app_pipeline(audio):
|
|
21 |
return result_diarization + [None] * (10 - len(result_diarization))
|
22 |
|
23 |
|
24 |
-
gr.Interface(
|
25 |
app_pipeline,
|
26 |
gr.Audio(type="numpy", label="Input"),
|
27 |
[gr.Audio(visible=True) for i in range(10)],
|
@@ -29,4 +30,10 @@ gr.Interface(
|
|
29 |
examples=example_list,
|
30 |
cache_examples=False,
|
31 |
|
32 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import gradio as gr
|
4 |
|
5 |
from main_pipeline import main_pipeline
|
|
|
7 |
|
8 |
url = "https://t.me/diarizarion_bot"
|
9 |
|
|
|
10 |
title = "Audio_denoise and speaker diarization.Faster inference <a href='{}' target='_blank'>tg_bot</a>".format(url)
|
11 |
|
12 |
example_list = [
|
|
|
22 |
return result_diarization + [None] * (10 - len(result_diarization))
|
23 |
|
24 |
|
25 |
+
iface = gr.Interface(
|
26 |
app_pipeline,
|
27 |
gr.Audio(type="numpy", label="Input"),
|
28 |
[gr.Audio(visible=True) for i in range(10)],
|
|
|
30 |
examples=example_list,
|
31 |
cache_examples=False,
|
32 |
|
33 |
+
)
|
34 |
+
|
35 |
+
if 'PORT' in os.environ.keys():
|
36 |
+
iface.launch(enable_queue=True,auth=(os.environ["login"], os.environ["password"]), server_name="0.0.0.0",
|
37 |
+
server_port=int(os.environ["PORT"]))
|
38 |
+
else:
|
39 |
+
iface.launch(enable_queue=True)
|