Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,22 @@ def translate(text):
|
|
| 10 |
output = model.generate(input["input_ids"], max_length=40, num_beams=4, early_stopping=True)
|
| 11 |
|
| 12 |
return tokenizer.decode(output[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
iface = gr.Interface(fn=translate, inputs=
|
| 15 |
iface.launch()
|
|
|
|
| 10 |
output = model.generate(input["input_ids"], max_length=40, num_beams=4, early_stopping=True)
|
| 11 |
|
| 12 |
return tokenizer.decode(output[0])
|
| 13 |
+
|
| 14 |
+
title = "Spanish to Quechua translation"
|
| 15 |
+
inputs = gr.inputs.Textbox(lines=1, label="Text in Spanish")
|
| 16 |
+
outputs = [gr.outputs.Textbox(label="Translated text in Quechua")]
|
| 17 |
+
|
| 18 |
+
description = "Here use the [t5-small-finetuned-spanish-to-quechua-model](https://huggingface.co/hackathon-pln-es/t5-small-finetuned-spanish-to-quechua) that was trained with [spanish-to-quechua dataset](https://huggingface.co/datasets/hackathon-pln-es/spanish-to-quechua)."
|
| 19 |
+
|
| 20 |
+
article = '''
|
| 21 |
+
## Challenges
|
| 22 |
+
- Create a dataset, as there are different variants of Quechua.
|
| 23 |
+
- Training of the model to optimize results using the least amount of computational resources.
|
| 24 |
+
|
| 25 |
+
## Team members
|
| 26 |
+
- [Sara Benel](https://huggingface.co/sbenel)
|
| 27 |
+
- [Jose Vílchez](https://huggingface.co/JCarlos)
|
| 28 |
+
'''
|
| 29 |
|
| 30 |
+
iface = gr.Interface(fn=translate, inputs=inputs, outputs=outputs, examples=examples, title=title, description=description, article=article)
|
| 31 |
iface.launch()
|