Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,14 +27,15 @@ with col2:
|
|
27 |
elif select_model == 'OPT-125m':
|
28 |
model = 'facebook/opt-125m'
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
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 |
|