Pippoz commited on
Commit
662f9f2
1 Parent(s): d234736

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -27,14 +27,15 @@ with col2:
27
  elif select_model == 'OPT-125m':
28
  model = 'facebook/opt-125m'
29
 
30
- if select_model:
31
- with st.spinner('Loading Model... (This may take a while)'):
32
- generator = get_model()
33
- st.success('Model loaded correctly!')
34
 
 
35
  answer = generator(prompt,
36
  max_length=100,
37
- no_repeat_ngram_size=3, early_stopping=True, num_beams=10, skip_special_tokens=True)
 
38
 
39
  lst = answer[0]['generated_text']
40
 
 
27
  elif select_model == 'OPT-125m':
28
  model = 'facebook/opt-125m'
29
 
30
+ with st.spinner('Loading Model... (This may take a while)'):
31
+ generator = get_model()
32
+ st.success('Model loaded correctly!')
 
33
 
34
+ gen = st.info('Generating text...')
35
  answer = generator(prompt,
36
  max_length=100,
37
+ no_repeat_ngram_size=3, early_stopping=True, num_beams=10, skip_special_tokens=True)
38
+ gen.empty()
39
 
40
  lst = answer[0]['generated_text']
41