Pippoz commited on
Commit
6c00c5c
1 Parent(s): 45df3a5

Update pages/fill_mask.py

Browse files
Files changed (1) hide show
  1. pages/fill_mask.py +3 -3
pages/fill_mask.py CHANGED
@@ -12,8 +12,8 @@ def app():
12
 
13
 
14
  @st.cache(allow_output_mutation=True, suppress_st_warning =True, show_spinner=False)
15
- def get_model():
16
- return pipeline('fill-mask', model='bert-base-uncased')
17
 
18
  def create_graph(answer):
19
  x_bar = [i['token_str'] for i in answer]
@@ -50,7 +50,7 @@ def app():
50
  model = 'bert-base-uncased'
51
 
52
  with st.spinner('Loading Model... (This may take a while)'):
53
- unmasker = get_model()
54
  st.success('Model loaded correctly!')
55
 
56
  gen = st.info('Generating text...')
 
12
 
13
 
14
  @st.cache(allow_output_mutation=True, suppress_st_warning =True, show_spinner=False)
15
+ def get_model(model):
16
+ return pipeline('fill-mask', model=model)
17
 
18
  def create_graph(answer):
19
  x_bar = [i['token_str'] for i in answer]
 
50
  model = 'bert-base-uncased'
51
 
52
  with st.spinner('Loading Model... (This may take a while)'):
53
+ unmasker = get_model(model)
54
  st.success('Model loaded correctly!')
55
 
56
  gen = st.info('Generating text...')