Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
@@ -113,15 +113,18 @@ st.subheader("Answer:")
|
|
113 |
|
114 |
|
115 |
if decoder_model == "GPT3 - (text-davinci-003)":
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
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()
|