Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -47,13 +47,18 @@ def dl(inp,img=None):
|
|
47 |
def diarize_aud(file_name):
|
48 |
print(file_name)
|
49 |
os.system(f"python diarize.py -a {file_name}")
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
with gr.Blocks() as app:
|
53 |
inp_url=gr.Textbox()
|
54 |
btn=gr.Button()
|
55 |
btn2=gr.Button("diarize")
|
56 |
-
outp_aud=gr.Audio()
|
57 |
outp_diary=gr.Textbox()
|
58 |
btn.click(dl,inp_url,outp_aud)
|
59 |
btn2.click(diarize_aud,outp_aud,outp_diary)
|
|
|
47 |
def diarize_aud(file_name):
|
48 |
print(file_name)
|
49 |
os.system(f"python diarize.py -a {file_name}")
|
50 |
+
with open(f"{file_name}.txt","r") as f:
|
51 |
+
lines=f.readlines()
|
52 |
+
line_out=""
|
53 |
+
for line in lines:
|
54 |
+
line_out+=line
|
55 |
+
return line_out
|
56 |
|
57 |
with gr.Blocks() as app:
|
58 |
inp_url=gr.Textbox()
|
59 |
btn=gr.Button()
|
60 |
btn2=gr.Button("diarize")
|
61 |
+
outp_aud=gr.Audio(type='filepath')
|
62 |
outp_diary=gr.Textbox()
|
63 |
btn.click(dl,inp_url,outp_aud)
|
64 |
btn2.click(diarize_aud,outp_aud,outp_diary)
|