ANYANTUDRE commited on
Commit
f9ec5b7
·
1 Parent(s): 7c7161e

refactor app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -2
app.py CHANGED
@@ -5,7 +5,6 @@ import os
5
  from languages import get_language_names
6
  from goai_helpers import goai_traduction, goai_stt, goai_stt2, goai_tts, goai_tts2, goai_ttt_tts_pipeline, goai_stt_ttt_pipeline
7
 
8
-
9
  auth_token = os.getenv('HF_SPACE_TOKEN')
10
  login(token=auth_token)
11
 
@@ -13,6 +12,9 @@ login(token=auth_token)
13
  # list all files in the ./audios directory for the dropdown
14
  AUDIO_FILES = [f for f in os.listdir('./exples_voix') if os.path.isfile(os.path.join('./exples_voix', f))]
15
  MODELES_TTS = ["ArissBandoss/coqui-tts-moore-V1", "ArissBandoss/mms-tts-mos-V18"]
 
 
 
16
  DESCRIPTION = """<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
17
  <div style="flex: 1; min-width: 250px;">
18
  Ce modèle de traduction vers la <b>langue Mooré</b> a été développé from scratch par <b>GO AI CORP</b> et la version disponible en test est celle à 700 millions de paramètres.
@@ -58,7 +60,12 @@ goai_stt_if = gr.Interface(
58
  value="ArissBandoss/whisper-small-mos",
59
  label="Model Name"
60
  ),
61
- gr.Dropdown(choices=["Automatic Detection"] + sorted(get_language_names()), value="Automatic Detection", label="Language", interactive = True,),
 
 
 
 
 
62
  gr.Slider(label="Batch Size", minimum=1, maximum=32, value=8, step=1),
63
  gr.Slider(label="Chunk Length (s)", minimum=1, maximum=60, value=17.5, step=0.1),
64
  gr.Slider(label="Stride Length (s)", minimum=1, maximum=30, value=1, step=0.1),
@@ -118,6 +125,17 @@ goai_stt_ttt_pipeline_if = gr.Interface(
118
  fn=goai_stt_ttt_pipeline.goai_stt_ttt,
119
  inputs=[
120
  gr.Audio(sources=["microphone", "upload"], type="filepath"),
 
 
 
 
 
 
 
 
 
 
 
121
  gr.Slider(label="Batch Size", minimum=1, maximum=32, value=8, step=1),
122
  gr.Slider(label="Chunk Length (s)", minimum=1, maximum=60, value=17.5, step=0.1),
123
  gr.Slider(label="Stride Length (s)", minimum=1, maximum=30, value=1, step=0.1),
 
5
  from languages import get_language_names
6
  from goai_helpers import goai_traduction, goai_stt, goai_stt2, goai_tts, goai_tts2, goai_ttt_tts_pipeline, goai_stt_ttt_pipeline
7
 
 
8
  auth_token = os.getenv('HF_SPACE_TOKEN')
9
  login(token=auth_token)
10
 
 
12
  # list all files in the ./audios directory for the dropdown
13
  AUDIO_FILES = [f for f in os.listdir('./exples_voix') if os.path.isfile(os.path.join('./exples_voix', f))]
14
  MODELES_TTS = ["ArissBandoss/coqui-tts-moore-V1", "ArissBandoss/mms-tts-mos-V18"]
15
+ MODELES_ASR = ["ArissBandoss/whisper-small-mos"]
16
+ LANGUAGES = ["Automatic Detection"]
17
+
18
  DESCRIPTION = """<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
19
  <div style="flex: 1; min-width: 250px;">
20
  Ce modèle de traduction vers la <b>langue Mooré</b> a été développé from scratch par <b>GO AI CORP</b> et la version disponible en test est celle à 700 millions de paramètres.
 
60
  value="ArissBandoss/whisper-small-mos",
61
  label="Model Name"
62
  ),
63
+ gr.Dropdown(
64
+ choices=LANGUAGES,
65
+ value="Automatic Detection", # + sorted(get_language_names())
66
+ label="Language",
67
+ interactive = True,
68
+ ),
69
  gr.Slider(label="Batch Size", minimum=1, maximum=32, value=8, step=1),
70
  gr.Slider(label="Chunk Length (s)", minimum=1, maximum=60, value=17.5, step=0.1),
71
  gr.Slider(label="Stride Length (s)", minimum=1, maximum=30, value=1, step=0.1),
 
125
  fn=goai_stt_ttt_pipeline.goai_stt_ttt,
126
  inputs=[
127
  gr.Audio(sources=["microphone", "upload"], type="filepath"),
128
+ gr.Dropdown(
129
+ label="Modèles d'ASR",
130
+ choices=MODELES_ASR,
131
+ value="Automatic Detection"
132
+ ),
133
+ gr.Dropdown(
134
+ choices=LANGUAGES,
135
+ value="Automatic Detection", # + sorted(get_language_names())
136
+ label="Language",
137
+ interactive = True,
138
+ ),
139
  gr.Slider(label="Batch Size", minimum=1, maximum=32, value=8, step=1),
140
  gr.Slider(label="Chunk Length (s)", minimum=1, maximum=60, value=17.5, step=0.1),
141
  gr.Slider(label="Stride Length (s)", minimum=1, maximum=30, value=1, step=0.1),