Update app.py
Browse files123456789from transformers import pipelineimport gradio as grpipe = pipeline("text2text-generation", model="Helsinki-NLP/opus-mt-en-es")result = pipe("Hello, how are you?")print(result)demo = gr.Interface.from_pipeline(pipe)demo.launch()12345678910111213141516from transformers import pipelineimport gradio as gr# Use "translation" for specific Helsinki-NLP modelspipe = pipeline("translation_en_to_es", model="Helsinki-NLP/opus-mt-en-es")# Inferenceresult = pipe("Hello, how are you?")print(result)# Gradio Interfacedemo = gr.Interface.from_pipeline(pipe)if __name__ == "__main__":demo.launch()
app.py+9-2