awinml commited on
Commit
72a93a0
1 Parent(s): 1602adf

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -113,15 +113,18 @@ st.subheader("Answer:")
113
 
114
 
115
  if decoder_model == "GPT3 - (text-davinci-003)":
116
- openai_key = st.text_input(
117
- "Enter OpenAI key",
118
- value=st.secrets["openai_key"],
119
- type="password",
120
- )
121
- api_key = save_key(openai_key)
122
- openai.api_key = api_key
123
- generated_text = gpt3(query_text, context_list)
124
- st.write(generated_text)
 
 
 
125
 
126
  elif decoder_model == "T5":
127
  t5_pipeline = get_t5_model()
 
113
 
114
 
115
  if decoder_model == "GPT3 - (text-davinci-003)":
116
+ with st.form("my_form"):
117
+ openai_key = st.text_input(
118
+ "Enter OpenAI key",
119
+ value="",
120
+ type="password",
121
+ )
122
+ submitted = st.form_submit_button("Submit")
123
+ if submitted:
124
+ api_key = save_key(openai_key)
125
+ openai.api_key = api_key
126
+ generated_text = gpt3(query_text, context_list)
127
+ st.write(generated_text)
128
 
129
  elif decoder_model == "T5":
130
  t5_pipeline = get_t5_model()