Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
|
|
|
3 |
|
4 |
-
text = st.text_area('Enter the text:')
|
5 |
model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-one-to-many-mmt")
|
|
|
|
|
6 |
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-one-to-many-mmt", src_large="en_XX")
|
|
|
|
|
|
|
7 |
|
8 |
if text:
|
9 |
model_inputs = tokenizer(text, return_tensors="pt")
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
|
3 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
4 |
|
|
|
5 |
model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-one-to-many-mmt")
|
6 |
+
model = AutoModelForMaskedLM.from_pretrained("alabnii/jmedroberta-base-sentencepiece")
|
7 |
+
modek.eval()
|
8 |
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-one-to-many-mmt", src_large="en_XX")
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("alabnii/jmedroberta-base-sentencepiece")
|
10 |
+
|
11 |
+
text = st.text_area('Enter the text:')
|
12 |
|
13 |
if text:
|
14 |
model_inputs = tokenizer(text, return_tensors="pt")
|