Spaces:
Runtime error
Runtime error
sergiolucero
commited on
Commit
•
5745839
1
Parent(s):
6086021
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,22 @@
|
|
1 |
import gradio as gr
|
2 |
from pydub import AudioSegment
|
3 |
-
from ailib import whisper_transcribe, summarize
|
4 |
import pandas as pd
|
5 |
|
6 |
def transcribe(audiofile):
|
7 |
#audio = AudioSegment.from_file(audiofile)
|
8 |
#open(filename, 'wb').write(audio)
|
9 |
consulta = whisper_transcribe(audiofile)
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
13 |
|
14 |
def display_text(paciente):
|
15 |
resumen_historial = df[df.paciente==paciente]['Resumen'].iloc[0]
|
16 |
historial = df[df.paciente==paciente]['EHR'].iloc[0]
|
|
|
17 |
|
18 |
return resumen_historial, historial
|
19 |
|
|
|
1 |
import gradio as gr
|
2 |
from pydub import AudioSegment
|
3 |
+
from ailib import whisper_transcribe, summarize, nueva_ficha
|
4 |
import pandas as pd
|
5 |
|
6 |
def transcribe(audiofile):
|
7 |
#audio = AudioSegment.from_file(audiofile)
|
8 |
#open(filename, 'wb').write(audio)
|
9 |
consulta = whisper_transcribe(audiofile)
|
10 |
+
resumen_consulta = summarize(consulta)
|
11 |
+
resumen_historial = open('resumen.txt').read()
|
12 |
+
nueva = nueva_ficha(resumen_historial, resumen_consulta)
|
13 |
+
|
14 |
+
return consulta, resumen_consulta, nueva
|
15 |
|
16 |
def display_text(paciente):
|
17 |
resumen_historial = df[df.paciente==paciente]['Resumen'].iloc[0]
|
18 |
historial = df[df.paciente==paciente]['EHR'].iloc[0]
|
19 |
+
open('resumen.txt', 'w').write(resumen_historial)
|
20 |
|
21 |
return resumen_historial, historial
|
22 |
|