orlandopozo commited on
Commit
b2e759c
·
verified ·
1 Parent(s): 60bc79f

Helsinki-NLP/opus-mt-en-es translation pre-trained model

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ prompt = st.text_area("Enter text to translate to Spanish:")
5
+
6
+ if prompt:
7
+ translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
8
+ out = translator(prompt)
9
+
10
+ st.json(out)