Update app.py
Browse files
app.py
CHANGED
|
@@ -28,18 +28,17 @@ def transcribe(audio, history_type):
|
|
| 28 |
print(f"Received audio file path: {audio}")
|
| 29 |
|
| 30 |
history_type_map = {
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"Feedback": "
|
| 38 |
-
"Hallway Consult": "
|
| 39 |
-
"Dx/DDx": "Weldon_Dx_DDx_Format.txt"
|
| 40 |
}
|
| 41 |
|
| 42 |
-
file_name = history_type_map.get(history_type, "
|
| 43 |
with open(f"Format_Library/{file_name}", "r") as f:
|
| 44 |
role = f.read()
|
| 45 |
messages = [{"role": "system", "content": role}]
|
|
@@ -132,7 +131,7 @@ my_inputs = [
|
|
| 132 |
#gr.Audio(sources=["microphone"], type="filepath",format="wav"), #Gradio 4.x
|
| 133 |
#gr.Audio(sources=["microphone"],type="numpy",editable="false"), #Gradio 4.x
|
| 134 |
gr.Microphone(type="filepath",format="wav"), #Gradio 4.x
|
| 135 |
-
gr.Radio(["
|
| 136 |
]
|
| 137 |
|
| 138 |
ui = gr.Interface(fn=transcribe,
|
|
|
|
| 28 |
print(f"Received audio file path: {audio}")
|
| 29 |
|
| 30 |
history_type_map = {
|
| 31 |
+
"History Simple": "McIntyre_Short_History.txt",
|
| 32 |
+
"History Complex": "McIntyre_Long_History.txt",
|
| 33 |
+
"Full Visit": "McIntyre_Full_Visit.txt",
|
| 34 |
+
"Impression/Plan": "McIntyre_Impression.txt",
|
| 35 |
+
"EMS": "McIntyre_EMS_Handover.txt",
|
| 36 |
+
"Dx/DDx": "McIntyre_Dx_DDx_Format.txt",
|
| 37 |
+
"Feedback": "McIntyre_Feedback.txt",
|
| 38 |
+
"Hallway Consult": "McIntyre_Hallway_Consult_Format.txt"
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
+
file_name = history_type_map.get(history_type, "McIntyre_Full_Visit.txt")
|
| 42 |
with open(f"Format_Library/{file_name}", "r") as f:
|
| 43 |
role = f.read()
|
| 44 |
messages = [{"role": "system", "content": role}]
|
|
|
|
| 131 |
#gr.Audio(sources=["microphone"], type="filepath",format="wav"), #Gradio 4.x
|
| 132 |
#gr.Audio(sources=["microphone"],type="numpy",editable="false"), #Gradio 4.x
|
| 133 |
gr.Microphone(type="filepath",format="wav"), #Gradio 4.x
|
| 134 |
+
gr.Radio(["History Simple","History Complex","Full Visit","Impression/Plan","EMS","Dx/DDx","Feedback","Hallway Consult"], show_label=False),
|
| 135 |
]
|
| 136 |
|
| 137 |
ui = gr.Interface(fn=transcribe,
|