sentencebird commited on
Commit
ba31b89
1 Parent(s): 4abe569

update: load_model

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -63,13 +63,11 @@ lang_codes_by_name = \
63
  'Galician': 'gl_ES',
64
  'Slovene': 'sl_SI'}
65
 
66
- # @st.cache(allow_output_mutation=True)
67
  def load_model():
68
- f = open("model.pkl", "rb")
69
- return pickle.load(f)
70
- #return MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
71
 
72
- # @st.cache(allow_output_mutation=True)
73
  def load_tokenizer():
74
  return MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-many-to-many-mmt", use_fast=False)
75
 
 
63
  'Galician': 'gl_ES',
64
  'Slovene': 'sl_SI'}
65
 
66
+ @st.cache(allow_output_mutation=True)
67
  def load_model():
68
+ return MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
 
 
69
 
70
+ @st.cache(allow_output_mutation=True)
71
  def load_tokenizer():
72
  return MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-many-to-many-mmt", use_fast=False)
73