Spaces:
Runtime error
Runtime error
sentencebird
commited on
Commit
•
ba31b89
1
Parent(s):
4abe569
update: load_model
Browse files
app.py
CHANGED
@@ -63,13 +63,11 @@ lang_codes_by_name = \
|
|
63 |
'Galician': 'gl_ES',
|
64 |
'Slovene': 'sl_SI'}
|
65 |
|
66 |
-
|
67 |
def load_model():
|
68 |
-
|
69 |
-
return pickle.load(f)
|
70 |
-
#return MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
|
71 |
|
72 |
-
|
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 |
|