Hamda commited on
Commit
e8b8e81
1 Parent(s): a540e37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
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
- @st.cache
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':[],