Spaces:
Sleeping
Sleeping
Srivatsa Kundurthy
commited on
Commit
•
dfa4663
1
Parent(s):
f584d35
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
app = gr.Blocks()
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
mic_mode = gr.Interface(
|
8 |
+
fn=inference,
|
9 |
+
inputs=gr.Audio(sources="microphone", type='filepath', label="Record Your Lecture"),
|
10 |
+
outputs=gr.Textbox(label="Transcription Output"),
|
11 |
+
title="🎙️ Live Lecture Transcription",
|
12 |
+
description="Record through your mic. When you're done, hit stop and wait a moment. Feel free to trim the recording. Then, hit Submit!",
|
13 |
+
examples=[],
|
14 |
+
)
|
15 |
+
|
16 |
+
|
17 |
+
upload_mode = gr.Interface(
|
18 |
+
fn=inference,
|
19 |
+
inputs=gr.Audio(sources="upload", type='filepath', label="Upload Your Lecture Recording"),
|
20 |
+
outputs=gr.Textbox(label="Transcription Output"),
|
21 |
+
title="📂 Lecture Recording Transcription",
|
22 |
+
description="Have a recorded lecture? Upload the audio file here, and it'll be transcribed in seconds!",
|
23 |
+
)
|
24 |
+
|
25 |
+
|
26 |
+
with app:
|
27 |
+
gr.Markdown(
|
28 |
+
"""
|
29 |
+
# Lecture Transcription 📝
|
30 |
+
|
31 |
+
Welcome to **Lecture Transcription**, the go-to tool for transcribing lectures accurately. Whether you’re attending a live lecture or revisiting a recorded one, this app will ensure you don’t miss a single detail.
|
32 |
+
|
33 |
+
## How It Works
|
34 |
+
- **Recording Mode:** Record the lecture as it happens. When you stop, your transcription will be generated.
|
35 |
+
- **Upload Mode:** Upload your pre-recorded lecture audio files, and receive a precise transcription. Supports various audio formats including WAV, MP3, and more.
|
36 |
+
|
37 |
+
## Optimized for Technical Oration
|
38 |
+
Under the hood, this is a Wav2Vec2 model fine-tuned on the TED-Lium dataset. It's well-versed for
|
39 |
+
accurately transcribing technical speech.
|
40 |
+
|
41 |
+
|
42 |
+
**Never miss a word with Lecture Transcription!**
|
43 |
+
"""
|
44 |
+
)
|
45 |
+
# Add a Tabbed Interface for different modes
|
46 |
+
gr.TabbedInterface(
|
47 |
+
[mic_mode, upload_mode],
|
48 |
+
["🎙️ Record & Transcribe", "📂 Upload & Transcribe"]
|
49 |
+
)
|
50 |
+
|
51 |
+
# Launch the app
|
52 |
+
app.launch()
|