Spaces:
Runtime error
Runtime error
Updated story to gpt2-medium
Browse files
app.py
CHANGED
@@ -21,8 +21,8 @@ MODELS = {
|
|
21 |
"GPT-2 Small finetuned on Indonesian academic journals": {
|
22 |
"url": "https://api-inference.huggingface.co/models/Galuh/id-journal-gpt2"
|
23 |
},
|
24 |
-
"GPT-2
|
25 |
-
"url": "https://api-inference.huggingface.co/models/cahya/gpt2-
|
26 |
},
|
27 |
}
|
28 |
|
@@ -101,7 +101,7 @@ top_k = st.sidebar.number_input(
|
|
101 |
|
102 |
top_p = st.sidebar.number_input(
|
103 |
"Top p",
|
104 |
-
value=
|
105 |
help=" If set to float < 1, only the most probable tokens with probabilities that add up to top_p or higher are kept for generation."
|
106 |
)
|
107 |
|
@@ -123,13 +123,13 @@ model_name = st.selectbox('Model',([
|
|
123 |
'GPT-2 Small',
|
124 |
'GPT-2 Medium',
|
125 |
'GPT-2 Small finetuned on Indonesian academic journals',
|
126 |
-
'GPT-2
|
127 |
|
128 |
if model_name in ["GPT-2 Small", "GPT-2 Medium"]:
|
129 |
prompt_group_name = "GPT-2"
|
130 |
elif model_name in ["GPT-2 Small finetuned on Indonesian academic journals"]:
|
131 |
prompt_group_name = "Indonesian Journals"
|
132 |
-
elif model_name in ["GPT-2
|
133 |
prompt_group_name = "Indonesian Stories"
|
134 |
|
135 |
session_state = SessionState.get(prompt=None, prompt_box=None, text=None)
|
|
|
21 |
"GPT-2 Small finetuned on Indonesian academic journals": {
|
22 |
"url": "https://api-inference.huggingface.co/models/Galuh/id-journal-gpt2"
|
23 |
},
|
24 |
+
"GPT-2 Medium finetuned on Indonesian stories": {
|
25 |
+
"url": "https://api-inference.huggingface.co/models/cahya/gpt2-medium-indonesian-story"
|
26 |
},
|
27 |
}
|
28 |
|
|
|
101 |
|
102 |
top_p = st.sidebar.number_input(
|
103 |
"Top p",
|
104 |
+
value=0.95,
|
105 |
help=" If set to float < 1, only the most probable tokens with probabilities that add up to top_p or higher are kept for generation."
|
106 |
)
|
107 |
|
|
|
123 |
'GPT-2 Small',
|
124 |
'GPT-2 Medium',
|
125 |
'GPT-2 Small finetuned on Indonesian academic journals',
|
126 |
+
'GPT-2 Medium finetuned on Indonesian stories']))
|
127 |
|
128 |
if model_name in ["GPT-2 Small", "GPT-2 Medium"]:
|
129 |
prompt_group_name = "GPT-2"
|
130 |
elif model_name in ["GPT-2 Small finetuned on Indonesian academic journals"]:
|
131 |
prompt_group_name = "Indonesian Journals"
|
132 |
+
elif model_name in ["GPT-2 Medium finetuned on Indonesian stories"]:
|
133 |
prompt_group_name = "Indonesian Stories"
|
134 |
|
135 |
session_state = SessionState.get(prompt=None, prompt_box=None, text=None)
|