playground-9 / app.py
orlandopozo's picture
Helsinki-NLP/opus-mt-en-es translation pre-trained model
b2e759c verified
raw
history blame contribute delete
258 Bytes
import streamlit as st
from transformers import pipeline
prompt = st.text_area("Enter text to translate to Spanish:")
if prompt:
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
out = translator(prompt)
st.json(out)