Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import torch
|
|
5 |
|
6 |
st.markdown('## Text-generation OPT from Meta ')
|
7 |
|
8 |
-
@st.cache(allow_output_mutation=True,show_spinner=False)
|
9 |
def get_model():
|
10 |
return pipeline('text-generation', model=model, skip_special_tokens=True)
|
11 |
|
@@ -24,9 +24,9 @@ with col2:
|
|
24 |
model = 'facebook/opt-125m'
|
25 |
|
26 |
if select_model:
|
27 |
-
with st.spinner('Loading Model... (This may take a while)')
|
28 |
-
|
29 |
-
|
30 |
|
31 |
|
32 |
with col1:
|
|
|
5 |
|
6 |
st.markdown('## Text-generation OPT from Meta ')
|
7 |
|
8 |
+
@st.cache(allow_output_mutation=True, suppress_st_warning =True, show_spinner=False)
|
9 |
def get_model():
|
10 |
return pipeline('text-generation', model=model, skip_special_tokens=True)
|
11 |
|
|
|
24 |
model = 'facebook/opt-125m'
|
25 |
|
26 |
if select_model:
|
27 |
+
with st.spinner('Loading Model... (This may take a while)'):
|
28 |
+
generator = get_model()
|
29 |
+
st.success('Model loaded correctly!')
|
30 |
|
31 |
|
32 |
with col1:
|