Mgolo commited on
Commit
cf94bdf
·
verified ·
1 Parent(s): 7c3f4e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -24,6 +24,7 @@ MODELS = {
24
  ("Wolof", "English"): {"model_name": "LocaleNLP/localenlp-wol-eng-0.03", "tag": ">>eng<<"},
25
  ("English", "Hausa"): {"model_name": "LocaleNLP/localenlp-eng-hau-0.01", "tag": ">>hau<<"},
26
  ("Hausa", "English"): {"model_name": "LocaleNLP/localenlp-hau-eng-0.01", "tag": ">>eng<<"},
 
27
  }
28
 
29
  HF_TOKEN = os.getenv("hffff")
@@ -127,12 +128,12 @@ def process_input(input_mode, input_lang, text, audio_file, file_obj):
127
  # Gradio UI
128
  with gr.Blocks() as demo:
129
  gr.Markdown("## LocaleNLP Multi-language Translator")
130
- gr.Markdown("Translate between English, Wolof, and Hausa. Audio input only accepts English.")
131
 
132
  with gr.Row():
133
  input_mode = gr.Radio(choices=["Text", "Audio", "File"], label="Input type", value="Text")
134
  input_lang = gr.Dropdown(choices=["English", "Wolof", "Hausa"], label="Input language", value="English")
135
- output_lang = gr.Dropdown(choices=["English", "Wolof", "Hausa"], label="Output language", value="Hausa")
136
 
137
  input_text = gr.Textbox(label="Enter text", lines=10, visible=True)
138
  audio_input = gr.Audio(label="Upload audio (.wav, .mp3, .m4a)", type="filepath", visible=False)
 
24
  ("Wolof", "English"): {"model_name": "LocaleNLP/localenlp-wol-eng-0.03", "tag": ">>eng<<"},
25
  ("English", "Hausa"): {"model_name": "LocaleNLP/localenlp-eng-hau-0.01", "tag": ">>hau<<"},
26
  ("Hausa", "English"): {"model_name": "LocaleNLP/localenlp-hau-eng-0.01", "tag": ">>eng<<"},
27
+ ("English", "Darija"): {"model_name": "LocaleNLP/english_darija", "tag": ">>dar<<"},
28
  }
29
 
30
  HF_TOKEN = os.getenv("hffff")
 
128
  # Gradio UI
129
  with gr.Blocks() as demo:
130
  gr.Markdown("## LocaleNLP Multi-language Translator")
131
+ gr.Markdown("Translate between English, Wolof, and Hausa. Now, audio input only accepts English.")
132
 
133
  with gr.Row():
134
  input_mode = gr.Radio(choices=["Text", "Audio", "File"], label="Input type", value="Text")
135
  input_lang = gr.Dropdown(choices=["English", "Wolof", "Hausa"], label="Input language", value="English")
136
+ output_lang = gr.Dropdown(choices=["English", "Wolof", "Hausa","Darija"], label="Output language", value="Wolof")
137
 
138
  input_text = gr.Textbox(label="Enter text", lines=10, visible=True)
139
  audio_input = gr.Audio(label="Upload audio (.wav, .mp3, .m4a)", type="filepath", visible=False)