Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,13 +19,14 @@ with gr.Blocks() as demo:
|
|
19 |
Based on the <a href="https://translation.ghananlp.org/">Khaya AI Translation API</a>, <a href="https://lesan.ai/">Lesan AI</a>, Google Translate API and the Mixtral model. Lesan is used for <b>Amharic</b> and <b>Tigrinya</b>, <a href="https://translation.ghananlp.org/">Khaya AI</a> is used for <b>Twi</b>, <b>Dagbani</b>, <b>Ewe</b>, <b>Ga</b>, <b>Gurene</b>, <b>Fante</b>, <b>Kikuyu</b>, <b>Kimeru</b>, <b>Luo</b>, <b>Yoruba</b> and Google is used for <b>Hausa</b>, <b>Swahili</b> and <b>Shona</b>.
|
20 |
""")
|
21 |
language_selector = gr.Dropdown(["Amharic","Twi","Dagbani","Ewe","Ga","Gurene","Fante","Hausa", "Kikuyu", "Kimeru", "Luo","Shona","Swahili","Tigrinya","Yoruba"],value="Twi",label="Choose Language! (default is Twi)", info="Language:")
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
btn = gr.Button("Chat")
|
28 |
-
btn.click(generate, inputs=[prompt,language_selector], outputs=[
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
demo.queue(max_size=20).launch()
|
|
|
19 |
Based on the <a href="https://translation.ghananlp.org/">Khaya AI Translation API</a>, <a href="https://lesan.ai/">Lesan AI</a>, Google Translate API and the Mixtral model. Lesan is used for <b>Amharic</b> and <b>Tigrinya</b>, <a href="https://translation.ghananlp.org/">Khaya AI</a> is used for <b>Twi</b>, <b>Dagbani</b>, <b>Ewe</b>, <b>Ga</b>, <b>Gurene</b>, <b>Fante</b>, <b>Kikuyu</b>, <b>Kimeru</b>, <b>Luo</b>, <b>Yoruba</b> and Google is used for <b>Hausa</b>, <b>Swahili</b> and <b>Shona</b>.
|
20 |
""")
|
21 |
language_selector = gr.Dropdown(["Amharic","Twi","Dagbani","Ewe","Ga","Gurene","Fante","Hausa", "Kikuyu", "Kimeru", "Luo","Shona","Swahili","Tigrinya","Yoruba"],value="Twi",label="Choose Language! (default is Twi)", info="Language:")
|
22 |
+
history = ""
|
23 |
+
with gr.Row(scale=4):
|
24 |
+
output = gr.Text(label="Conversation:")
|
25 |
+
history = history + "\n" + output
|
26 |
+
with gr.Row(scale=1):
|
27 |
+
prompt = gr.Text(label="Enter Text In Your Local Language:")
|
28 |
btn = gr.Button("Chat")
|
29 |
+
btn.click(generate, inputs=[prompt,language_selector], outputs=[history])
|
30 |
|
31 |
if __name__ == "__main__":
|
32 |
demo.queue(max_size=20).launch()
|