Mohamed Aymane Farhi commited on
Commit
538fed7
β€’
1 Parent(s): fcbf504

Add Tachelhit (shi).

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -1,29 +1,25 @@
1
  # -*- coding: utf-8 -*-
2
- import re
3
  from ttsmms import TTS
4
  import gradio as gr
5
 
6
- tts = TTS("khm")
7
-
8
- def sanitize(text):
9
- return re.sub(r"\u200b", "", text)
10
 
11
  def generate_voice(text):
12
  audio = tts.synthesis(text)
13
  return (audio['sampling_rate'], audio['x'])
14
 
15
- with gr.Blocks(title="Khmer Text to Speech with MMS", theme=gr.themes.Default(font=[gr.themes.GoogleFont("Noto Sans Khmer"), "Arial", "sans-serif"])) as blocks:
16
 
17
- gr.Markdown('# Khmer Text to Speech - MMS')
18
  gr.Markdown('MMS: Scaling Speech Technology to 1000+ languages by Meta AI')
19
 
20
- input_text = gr.Textbox(label="αž’αž€αŸ’αžŸαžš", lines=3)
21
- examples = gr.Examples(examples=["αž“αŸαŸ‡β€‹αž‡αžΆβ€‹αžšαžΌαž”αžαžβ€‹αž‡αž“αžŸαž„αŸ’αžŸαŸαž™β€‹αžŠαŸ‚αž›β€‹αž”αŸαžΈαž€αž‘αžΆαž“αŸ”", "αž—αŸ’αž“αŸ†αž–αŸ’αžšαŸ‡ αž¬αžαŸ’αž“αž„αž–αŸ’αžšαŸ‡ αž‡αžΆαžαŸ†αž”αž“αŸ‹αž’αŸαž€αžΌαžšαž‘αŸαžŸαž…αžšαžŽαŸαž’αž˜αŸ’αž˜αž‡αžΆαžαž·αžŠαŸαž‘αžΆαž€αŸ‹αž‘αžΆαž‰αž˜αž½αž™αž€αŸ’αž“αž»αž„αž–αŸαž›αž”αž…αŸ’αž…αž»αž”αŸ’αž”αž“αŸ’αž“αŸ”"], inputs=[input_text])
22
 
23
- run_button = gr.Button(value="αž”αž„αŸ’αž€αžΎαž")
24
 
25
  out_audio = gr.Audio(
26
- label="αžŸαŸ†αž‘αŸαž„αžŠαŸ‚αž›αž”αžΆαž“αž”αž„αŸ’αž€αžΎαž",
27
  type="numpy",
28
  )
29
 
@@ -38,4 +34,4 @@ with gr.Blocks(title="Khmer Text to Speech with MMS", theme=gr.themes.Default(fo
38
  )
39
 
40
 
41
- blocks.queue(concurrency_count=1).launch(debug=True)
 
1
  # -*- coding: utf-8 -*-
 
2
  from ttsmms import TTS
3
  import gradio as gr
4
 
5
+ tts = TTS("shi")
 
 
 
6
 
7
  def generate_voice(text):
8
  audio = tts.synthesis(text)
9
  return (audio['sampling_rate'], audio['x'])
10
 
11
+ with gr.Blocks(title="Tachelhit Text to Speech with MMS") as blocks:
12
 
13
+ gr.Markdown('# Tashelhit Text to Speech - MMS')
14
  gr.Markdown('MMS: Scaling Speech Technology to 1000+ languages by Meta AI')
15
 
16
+ input_text = gr.Textbox(label="Input Text", lines=3)
17
+ #examples = gr.Examples(examples=["αž“αŸαŸ‡β€‹αž‡αžΆβ€‹αžšαžΌαž”αžαžβ€‹αž‡αž“αžŸαž„αŸ’αžŸαŸαž™β€‹αžŠαŸ‚αž›β€‹αž”αŸαžΈαž€αž‘αžΆαž“αŸ”", "αž—αŸ’αž“αŸ†αž–αŸ’αžšαŸ‡ αž¬αžαŸ’αž“αž„αž–αŸ’αžšαŸ‡ αž‡αžΆαžαŸ†αž”αž“αŸ‹αž’αŸαž€αžΌαžšαž‘αŸαžŸαž…αžšαžŽαŸαž’αž˜αŸ’αž˜αž‡αžΆαžαž·αžŠαŸαž‘αžΆαž€αŸ‹αž‘αžΆαž‰αž˜αž½αž™αž€αŸ’αž“αž»αž„αž–αŸαž›αž”αž…αŸ’αž…αž»αž”αŸ’αž”αž“αŸ’αž“αŸ”"], inputs=[input_text])
18
 
19
+ run_button = gr.Button(value="Run")
20
 
21
  out_audio = gr.Audio(
22
+ label="Output Audio",
23
  type="numpy",
24
  )
25
 
 
34
  )
35
 
36
 
37
+ blocks.queue(concurrency_count=1).launch(debug=True)