CoolFace
Modelpublic

haouarin/TextGeneration

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
0likes
app.py17 linesDownload Raw Back to root
1import gradio as gr2 3from transformers import pipeline4 5pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")6 7def predict(text):8  return pipe(text)[0]["translation_text"]9 10iface = gr.Interface(11  fn=predict, 12  inputs='text',13  outputs='text',14  examples=[["Hello! My name is Omar"]]15)16 17iface.launch()