Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,9 @@ from transformers import pipeline
|
|
4 |
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
5 |
|
6 |
tokenizer = AutoTokenizer.from_pretrained("moussaKam/AraBART", padding= True, truncation=True, max_length=128)
|
7 |
-
|
8 |
-
def load_model(model_name):
|
9 |
-
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
10 |
-
return model
|
11 |
-
model = load_model("moussaKam/AraBART")
|
12 |
|
13 |
|
14 |
-
@st.cache
|
15 |
def next_word(text, pipe):
|
16 |
res_dict= {
|
17 |
'token_str':[],
|
|
|
4 |
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
5 |
|
6 |
tokenizer = AutoTokenizer.from_pretrained("moussaKam/AraBART", padding= True, truncation=True, max_length=128)
|
7 |
+
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
|
|
10 |
def next_word(text, pipe):
|
11 |
res_dict= {
|
12 |
'token_str':[],
|