Translator / app.py
CASLL's picture
Update app.py
ecf93cb verified
raw
history blame
378 Bytes
import streamlit as st
import transformers
from transformers import pipeline
translator = pipeline(
"translation",
model="Helsinki-NLP/opus-mt-fr-en",
)
title = st.title("Tradutor FR to EN")
txt = st.text_area("Setença para traduzir:",)
if st.button("Traduzir"):
fr_txt = txt
translation = translator(fr_txt)
print(translation[0]['translation_text'])