Spaces:
Sleeping
Sleeping
orlandopozo
commited on
Helsinki-NLP/opus-mt-en-es translation pre-trained model
Browse files
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)
|