Spaces:
Running
on
Zero
Running
on
Zero
Commit
Β·
073e6e9
1
Parent(s):
c7ed412
fix gradio text
Browse files
app.py
CHANGED
@@ -1,18 +1,12 @@
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import os
|
4 |
-
import pathlib
|
5 |
-
from typing import Any, Dict
|
6 |
|
7 |
import gradio as gr
|
8 |
-
import numpy as np
|
9 |
-
import torch
|
10 |
|
11 |
-
|
12 |
import torchaudio
|
13 |
|
14 |
-
# from fairseq2.assets import InProcAssetMetadataProvider, asset_store
|
15 |
-
from huggingface_hub import snapshot_download
|
16 |
from transformers import (
|
17 |
SeamlessM4TFeatureExtractor,
|
18 |
SeamlessM4TTokenizer,
|
@@ -25,19 +19,23 @@ from lang_list import (
|
|
25 |
S2ST_TARGET_LANGUAGE_NAMES,
|
26 |
S2TT_TARGET_LANGUAGE_NAMES,
|
27 |
T2ST_TARGET_LANGUAGE_NAMES,
|
28 |
-
# T2TT_TARGET_LANGUAGE_NAMES,
|
29 |
TEXT_SOURCE_LANGUAGE_NAMES,
|
30 |
)
|
31 |
|
32 |
|
33 |
DESCRIPTION = """\
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
41 |
"""
|
42 |
|
43 |
hf_token = os.getenv("HF_TOKEN")
|
@@ -206,9 +204,9 @@ with gr.Blocks() as demo_asr:
|
|
206 |
choices=ASR_TARGET_LANGUAGE_NAMES,
|
207 |
value=DEFAULT_TARGET_LANGUAGE,
|
208 |
)
|
209 |
-
btn = gr.Button("
|
210 |
with gr.Column():
|
211 |
-
output_text = gr.Textbox(label="
|
212 |
|
213 |
gr.Examples(
|
214 |
examples=[
|
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import os
|
|
|
|
|
4 |
|
5 |
import gradio as gr
|
|
|
|
|
6 |
|
7 |
+
import torch
|
8 |
import torchaudio
|
9 |
|
|
|
|
|
10 |
from transformers import (
|
11 |
SeamlessM4TFeatureExtractor,
|
12 |
SeamlessM4TTokenizer,
|
|
|
19 |
S2ST_TARGET_LANGUAGE_NAMES,
|
20 |
S2TT_TARGET_LANGUAGE_NAMES,
|
21 |
T2ST_TARGET_LANGUAGE_NAMES,
|
|
|
22 |
TEXT_SOURCE_LANGUAGE_NAMES,
|
23 |
)
|
24 |
|
25 |
|
26 |
DESCRIPTION = """\
|
27 |
+
### **IndicSeamlessM4T: Speech-to-Text Translation for Indian Languages** ποΈβ‘οΈπ
|
28 |
+
|
29 |
+
This Gradio demo showcases **IndicSeamlessM4T**, a fine-tuned **SeamlessM4T** model for **speech-to-text translation** across **13 Indian languages and English**. Trained on **BhasaAnuvaad**, the largest open-source speech translation dataset for Indian languages, it delivers **accurate and robust translations** across diverse linguistic and acoustic conditions.
|
30 |
+
|
31 |
+
π **Model Checkpoint:** [ai4bharat/seamless-m4t-v2-large-stt](https://huggingface.co/ai4bharat/seamless-m4t-v2-large-stt)
|
32 |
|
33 |
+
#### **How to Use:**
|
34 |
+
1. **Upload or record** an audio clip in any supported Indian language.
|
35 |
+
2. Click **"Translate"** to generate the corresponding text in the target language.
|
36 |
+
3. View or copy the output for further use.
|
37 |
+
|
38 |
+
π Try it out and experience seamless speech translation for Indian languages!
|
39 |
"""
|
40 |
|
41 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
204 |
choices=ASR_TARGET_LANGUAGE_NAMES,
|
205 |
value=DEFAULT_TARGET_LANGUAGE,
|
206 |
)
|
207 |
+
btn = gr.Button("Transcribe")
|
208 |
with gr.Column():
|
209 |
+
output_text = gr.Textbox(label="Transcribed text")
|
210 |
|
211 |
gr.Examples(
|
212 |
examples=[
|