traductor-mapudungun / generate_eban.py
hernanlira's picture
adding app.py
2b86d4e
raw
history blame
472 Bytes
from transformers import pipeline
def translate_es_to_mapudungun(text_es):
pipe = pipeline("text2text-generation", model="ebanebssa/es-arn")
translated_text = pipe(text_es)[0]['generated_text']
return translated_text
# Example usage (can be commented out or removed)
if __name__ == "__main__":
text_es = input("Enter text in Spanish: ")
translated_text = translate_es_to_mapudungun(text_es)
print("Translated text (Mapudungun):", translated_text)