Galuh Sahid commited on
Commit
b4d2987
1 Parent(s): 14929e5

fix reload

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -106,7 +106,7 @@ elif model_name in ["GPT-2 Small finetuned on Indonesian academic journals"]:
106
  session_state = SessionState.get(prompt=None, prompt_box=None, text=None)
107
 
108
  ALL_PROMPTS = list(PROMPT_LIST[prompt_group_name].keys())+["Custom"]
109
- prompt = st.selectbox('Prompt', ALL_PROMPTS, index=len(ALL_PROMPTS)-1)
110
 
111
  if session_state.prompt is not None and (prompt != session_state.prompt):
112
  session_state.prompt_box = None
@@ -115,7 +115,7 @@ if session_state.prompt is not None and (prompt != session_state.prompt):
115
  if session_state.prompt == "Custom":
116
  session_state.prompt_box = "Enter your text here"
117
  else:
118
- if session_state.prompt_box is None:
119
  session_state.prompt_box = random.choice(PROMPT_LIST[prompt_group_name][session_state.prompt])
120
 
121
  session_state.text = st.text_area("Enter text", session_state.prompt_box)
 
106
  session_state = SessionState.get(prompt=None, prompt_box=None, text=None)
107
 
108
  ALL_PROMPTS = list(PROMPT_LIST[prompt_group_name].keys())+["Custom"]
109
+ session_state.prompt = st.selectbox('Prompt', ALL_PROMPTS, index=len(ALL_PROMPTS)-1)
110
 
111
  if session_state.prompt is not None and (prompt != session_state.prompt):
112
  session_state.prompt_box = None
 
115
  if session_state.prompt == "Custom":
116
  session_state.prompt_box = "Enter your text here"
117
  else:
118
+ if session_state.prompt is not None and session_state.prompt_box is None:
119
  session_state.prompt_box = random.choice(PROMPT_LIST[prompt_group_name][session_state.prompt])
120
 
121
  session_state.text = st.text_area("Enter text", session_state.prompt_box)