Spaces:
Runtime error
Runtime error
breadlicker45
commited on
Commit
•
392eb9f
1
Parent(s):
768480e
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import time
|
|
3 |
from transformers import pipeline
|
4 |
import torch
|
5 |
trust_remote_code=True
|
6 |
-
st.markdown('## Text-generation
|
7 |
|
8 |
@st.cache(allow_output_mutation=True, suppress_st_warning =True, show_spinner=False)
|
9 |
def get_model():
|
@@ -14,9 +14,9 @@ col1, col2 = st.columns([2,1])
|
|
14 |
with st.sidebar:
|
15 |
st.markdown('## Model Parameters')
|
16 |
|
17 |
-
max_length = st.slider('Max text length', 0,
|
18 |
|
19 |
-
num_beams = st.slider('N° tree beams search', 2, 15,
|
20 |
|
21 |
early_stopping = st.selectbox(
|
22 |
'Early stopping text generation',
|
@@ -26,19 +26,19 @@ with st.sidebar:
|
|
26 |
|
27 |
with col1:
|
28 |
prompt= st.text_area('Your prompt here',
|
29 |
-
'''
|
30 |
|
31 |
with col2:
|
32 |
select_model = st.radio(
|
33 |
"Select the model to use:",
|
34 |
-
('
|
35 |
|
36 |
-
if select_model == '
|
37 |
-
model = '
|
38 |
-
elif select_model == '
|
39 |
model = 'breadlicker45/MusePy'
|
40 |
-
elif select_model == '
|
41 |
-
model = '
|
42 |
|
43 |
with st.spinner('Loading Model... (This may take a while)'):
|
44 |
generator = get_model()
|
|
|
3 |
from transformers import pipeline
|
4 |
import torch
|
5 |
trust_remote_code=True
|
6 |
+
st.markdown('## Text-generation gpt Muse models from Breadlicker')
|
7 |
|
8 |
@st.cache(allow_output_mutation=True, suppress_st_warning =True, show_spinner=False)
|
9 |
def get_model():
|
|
|
14 |
with st.sidebar:
|
15 |
st.markdown('## Model Parameters')
|
16 |
|
17 |
+
max_length = st.slider('Max text length', 0, 500, 80)
|
18 |
|
19 |
+
num_beams = st.slider('N° tree beams search', 2, 15, 2)
|
20 |
|
21 |
early_stopping = st.selectbox(
|
22 |
'Early stopping text generation',
|
|
|
26 |
|
27 |
with col1:
|
28 |
prompt= st.text_area('Your prompt here',
|
29 |
+
'''2623 2619 3970 3976 2607 3973 2735 3973 2598 3985 2726 3973 2607 4009 2735 3973 2598 3973 2726 3973 2607 3973 2735 4009''')
|
30 |
|
31 |
with col2:
|
32 |
select_model = st.radio(
|
33 |
"Select the model to use:",
|
34 |
+
('MuseWeb', 'MusePy', 'MuseNeo'), index = 2)
|
35 |
|
36 |
+
if select_model == 'MuseWeb':
|
37 |
+
model = 'breadlicker45/MuseWeb'
|
38 |
+
elif select_model == 'MusePy':
|
39 |
model = 'breadlicker45/MusePy'
|
40 |
+
elif select_model == 'MuseNeo':
|
41 |
+
model = 'breadlicker45/MuseNeo'
|
42 |
|
43 |
with st.spinner('Loading Model... (This may take a while)'):
|
44 |
generator = get_model()
|