Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,11 +13,11 @@ def load_model():
|
|
| 13 |
global model, processor
|
| 14 |
|
| 15 |
print("Loading model...")
|
| 16 |
-
model_id = "
|
| 17 |
|
| 18 |
|
| 19 |
model = Gemma3nForConditionalGeneration.from_pretrained(
|
| 20 |
-
|
| 21 |
device_map="auto",
|
| 22 |
torch_dtype=torch.bfloat16,
|
| 23 |
).eval()
|
|
@@ -85,13 +85,13 @@ def transcribe_audio(audio_path, max_tokens=128):
|
|
| 85 |
load_model()
|
| 86 |
|
| 87 |
# Create Gradio interface
|
| 88 |
-
with gr.Blocks(title="
|
| 89 |
gr.Markdown(
|
| 90 |
"""
|
| 91 |
-
# 🎙️
|
| 92 |
|
| 93 |
Upload an audio file or record your voice to get an automatic transcription.
|
| 94 |
-
|
| 95 |
"""
|
| 96 |
)
|
| 97 |
|
|
@@ -123,7 +123,7 @@ with gr.Blocks(title="Gemma 3n Audio Transcription") as demo:
|
|
| 123 |
"""
|
| 124 |
### Tips:
|
| 125 |
- For best results, use clear audio with minimal background noise
|
| 126 |
-
- The model
|
| 127 |
- Recording length should be reasonable (under 30 seconds recommended)
|
| 128 |
"""
|
| 129 |
)
|
|
|
|
| 13 |
global model, processor
|
| 14 |
|
| 15 |
print("Loading model...")
|
| 16 |
+
model_id = "oddadmix/gemma-4b-egyptian-code-switching-b4-g2-merged"
|
| 17 |
|
| 18 |
|
| 19 |
model = Gemma3nForConditionalGeneration.from_pretrained(
|
| 20 |
+
model_id,
|
| 21 |
device_map="auto",
|
| 22 |
torch_dtype=torch.bfloat16,
|
| 23 |
).eval()
|
|
|
|
| 85 |
load_model()
|
| 86 |
|
| 87 |
# Create Gradio interface
|
| 88 |
+
with gr.Blocks(title="Egyptian Code Switching Audio Transcription") as demo:
|
| 89 |
gr.Markdown(
|
| 90 |
"""
|
| 91 |
+
# 🎙️ Egyptian Code Switching Audio Transcription
|
| 92 |
|
| 93 |
Upload an audio file or record your voice to get an automatic transcription.
|
| 94 |
+
Specialized for Egyptian Arabic with English code-switching.
|
| 95 |
"""
|
| 96 |
)
|
| 97 |
|
|
|
|
| 123 |
"""
|
| 124 |
### Tips:
|
| 125 |
- For best results, use clear audio with minimal background noise
|
| 126 |
+
- The model specializes in Egyptian Arabic with English code-switching
|
| 127 |
- Recording length should be reasonable (under 30 seconds recommended)
|
| 128 |
"""
|
| 129 |
)
|