Pippoz commited on
Commit
8510941
1 Parent(s): 38a4071

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- generator = get_model()
29
- st.success('Model loaded correctly!')
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: