Spaces:
Running
Running
Commit
·
cac0a2c
1
Parent(s):
e13f72c
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,9 @@ import torch
|
|
10 |
import librosa #For converting audio sample rate to 16k
|
11 |
from easymms.models.tts import TTSModel #For TTS inference using EasyMMS
|
12 |
|
13 |
-
LANG = "dtp"
|
14 |
model_id = "facebook/mms-1b-all"
|
15 |
|
16 |
-
#Set target language to dtp (Kadazandusun)
|
17 |
processor = AutoProcessor.from_pretrained(model_id)
|
18 |
model = Wav2Vec2ForCTC.from_pretrained(model_id).to("cpu")
|
19 |
processor.tokenizer.set_target_lang(LANG)
|
@@ -44,23 +43,15 @@ def transcribe(input): #Gradio UI wrapper function
|
|
44 |
with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
45 |
gr.HTML(
|
46 |
"""
|
47 |
-
<h1 align="center">Ponutun Tuturan om Pomorolou Sinuat Boros Dusun</h1>
|
48 |
-
<h5 align="center"> Poomitanan kopogunaan do somit tutun tuturan om pomorolou sinuat (speech recognition and text-to-speech models)
|
49 |
-
|
50 |
-
<h6 align = "center">Guguno (app) diti winonsoi di Ander © 2023 id Universiti Teknologi PETRONAS</h6>
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
}
|
57 |
-
</style>
|
58 |
-
<h6 align = "center">
|
59 |
-
<div class = "container">
|
60 |
-
<div class = "image"> <a href='https://github.com/andergisomon/dtp-nlp-demo'><img src='https://img.shields.io/badge/Github-Code-success'></a> </div>
|
61 |
-
<div class = "image"></div>
|
62 |
-
<div class = "image"> <a href='https://huggingface.co/spaces/anderbogia/dtp-asr-demo-v2/'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue'></a> </div>
|
63 |
-
</div></h6>
|
64 |
""")
|
65 |
|
66 |
tts = TTSModel(LANG)
|
@@ -73,7 +64,7 @@ with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
|
73 |
|
74 |
with gr.Row():
|
75 |
with gr.Column(scale = 1):
|
76 |
-
gr.HTML("""<h1 align="center"><img src="https://andergisomon.github.io/dtp-nlp-demo/huminodun_dall_e.png", alt="
|
77 |
|
78 |
gr.Markdown("""
|
79 |
**Huminodun, nulai di somit pongulai kikito DALL-E**
|
|
|
10 |
import librosa #For converting audio sample rate to 16k
|
11 |
from easymms.models.tts import TTSModel #For TTS inference using EasyMMS
|
12 |
|
13 |
+
LANG = "dtp" #Change to tih for Timugon Murut or iba for Iban
|
14 |
model_id = "facebook/mms-1b-all"
|
15 |
|
|
|
16 |
processor = AutoProcessor.from_pretrained(model_id)
|
17 |
model = Wav2Vec2ForCTC.from_pretrained(model_id).to("cpu")
|
18 |
processor.tokenizer.set_target_lang(LANG)
|
|
|
43 |
with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
44 |
gr.HTML(
|
45 |
"""
|
46 |
+
<h1 align="center">Ponutun Tuturan om Pomorolou Sinuat Boros Dusun</h1>
|
47 |
+
<h5 align="center"> Poomitanan kopogunaan do somit tutun tuturan om pomorolou sinuat (speech recognition and text-to-speech models)
|
48 |
+
pinoluda' di Woyotanud Tuturan Gumukabang Tagayo di Meta (Meta Massive Multilingual Speech Project)</h5>
|
49 |
+
<h6 align = "center">Guguno (app) diti winonsoi di Ander © 2023 id Universiti Teknologi PETRONAS</h6>
|
50 |
+
|
51 |
+
<div style='display:flex; gap: 0.25rem; '>
|
52 |
+
<div class = "image"> <a href='https://github.com/andergisomon/dtp-nlp-demo'><img src='https://img.shields.io/badge/Github-Code-success'></a> </div>
|
53 |
+
<div class = "image"> <a href='https://huggingface.co/spaces/anderbogia/dtp-asr-demo-v2/'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue'></a> </div>
|
54 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
""")
|
56 |
|
57 |
tts = TTSModel(LANG)
|
|
|
64 |
|
65 |
with gr.Row():
|
66 |
with gr.Column(scale = 1):
|
67 |
+
gr.HTML("""<h1 align="center"><img src="https://andergisomon.github.io/dtp-nlp-demo/huminodun_dall_e.png", alt="" border="0" style="margin: 0 auto; height: 200px;" /></a></h1>""")
|
68 |
|
69 |
gr.Markdown("""
|
70 |
**Huminodun, nulai di somit pongulai kikito DALL-E**
|