Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def transcribe_and_respond(audio_file):
|
|
| 15 |
torch_dtype=torch.bfloat16
|
| 16 |
)
|
| 17 |
|
| 18 |
-
# Load the audio file
|
| 19 |
audio, sr = librosa.load(audio_file, sr=16000)
|
| 20 |
|
| 21 |
# Print audio properties for debugging
|
|
@@ -42,12 +42,15 @@ def transcribe_and_respond(audio_file):
|
|
| 42 |
|
| 43 |
iface = gr.Interface(
|
| 44 |
fn=transcribe_and_respond,
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
| 47 |
title="ShukaNotesApp",
|
| 48 |
-
description="Enter your
|
| 49 |
live=True
|
| 50 |
)
|
| 51 |
|
| 52 |
if __name__ == "__main__":
|
| 53 |
-
iface.launch()
|
|
|
|
| 15 |
torch_dtype=torch.bfloat16
|
| 16 |
)
|
| 17 |
|
| 18 |
+
# Load the audio file at 16kHz
|
| 19 |
audio, sr = librosa.load(audio_file, sr=16000)
|
| 20 |
|
| 21 |
# Print audio properties for debugging
|
|
|
|
| 42 |
|
| 43 |
iface = gr.Interface(
|
| 44 |
fn=transcribe_and_respond,
|
| 45 |
+
# Allow both file upload and microphone input by providing a list of sources.
|
| 46 |
+
inputs=gr.Audio(sources=["upload", "microphone"], type="filepath"),
|
| 47 |
+
outputs=[
|
| 48 |
+
gr.Textbox(label="Transcript"),
|
| 49 |
+
gr.File(label="Download Transcript")],
|
| 50 |
title="ShukaNotesApp",
|
| 51 |
+
description="Meeting Notes for Indian Offices Discussions. \n Enter your audio from meetings here and the model will share the key takeaways.",
|
| 52 |
live=True
|
| 53 |
)
|
| 54 |
|
| 55 |
if __name__ == "__main__":
|
| 56 |
+
iface.launch()
|