Spaces:
Runtime error
Runtime error
sergiolucero
commited on
Commit
•
fff86d3
1
Parent(s):
70fd3a4
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,28 @@
|
|
1 |
import gradio as gr
|
2 |
from pydub import AudioSegment
|
3 |
from ailib import whisper_transcribe
|
|
|
4 |
|
5 |
def transcribe(audiofile):
|
6 |
#audio = AudioSegment.from_file(audiofile)
|
7 |
#open(filename, 'wb').write(audio)
|
8 |
return whisper_transcribe(audiofile)
|
9 |
|
10 |
-
|
11 |
-
# gr.title("Demo CORFO")
|
12 |
-
|
13 |
def display_text(option):
|
14 |
left = 'LEFT:' + option
|
15 |
right = 'RIGHT:' + option
|
16 |
|
17 |
return left, right
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
with gr.Blocks() as demo:
|
20 |
-
with gr.Row():
|
21 |
-
|
22 |
audemo = gr.Interface(
|
23 |
transcribe,
|
24 |
gr.Audio(sources=["microphone"], type="filepath"),
|
@@ -26,7 +30,8 @@ with gr.Blocks() as demo:
|
|
26 |
)
|
27 |
with gr.Row():
|
28 |
with gr.Column(scale=1):
|
29 |
-
radio = gr.Radio(choices=
|
|
|
30 |
with gr.Column(scale=3):
|
31 |
with gr.Row():
|
32 |
left_text = gr.Markdown()
|
|
|
1 |
import gradio as gr
|
2 |
from pydub import AudioSegment
|
3 |
from ailib import whisper_transcribe
|
4 |
+
import pandas as pd
|
5 |
|
6 |
def transcribe(audiofile):
|
7 |
#audio = AudioSegment.from_file(audiofile)
|
8 |
#open(filename, 'wb').write(audio)
|
9 |
return whisper_transcribe(audiofile)
|
10 |
|
|
|
|
|
|
|
11 |
def display_text(option):
|
12 |
left = 'LEFT:' + option
|
13 |
right = 'RIGHT:' + option
|
14 |
|
15 |
return left, right
|
16 |
|
17 |
+
df = pd.read_csv('pacientes.csv')
|
18 |
+
pacientes = df['paciente'].unique() # now contains PAC_ID
|
19 |
+
pid_dict = dict(zip(df.paciente, df.pac_id))
|
20 |
+
################################################
|
21 |
+
# gr.title("Demo CORFO")
|
22 |
+
|
23 |
+
|
24 |
with gr.Blocks() as demo:
|
25 |
+
with gr.Row():
|
|
|
26 |
audemo = gr.Interface(
|
27 |
transcribe,
|
28 |
gr.Audio(sources=["microphone"], type="filepath"),
|
|
|
30 |
)
|
31 |
with gr.Row():
|
32 |
with gr.Column(scale=1):
|
33 |
+
radio = gr.Radio(choices=pacientes,
|
34 |
+
label="PACIENTE", value=pacientes[0], interactive=True)
|
35 |
with gr.Column(scale=3):
|
36 |
with gr.Row():
|
37 |
left_text = gr.Markdown()
|