Spaces:
Sleeping
Sleeping
research14
commited on
Commit
•
70a526c
1
Parent(s):
5160266
show prompt to user
Browse files
app.py
CHANGED
@@ -216,6 +216,7 @@ def interface():
|
|
216 |
|
217 |
# Outputs
|
218 |
|
|
|
219 |
# linguistic_features_textbox = gr.Textbox(label="Linguistic Features", disabled=True)
|
220 |
|
221 |
with gr.Row():
|
@@ -224,10 +225,15 @@ def interface():
|
|
224 |
vicuna_ling_ents_chatbot = gr.Chatbot(label="vicuna-7b")
|
225 |
clear = gr.ClearButton(components=[ling_ents_prompt, ling_ents_apikey_input, have_key2, linguistic_entities,
|
226 |
vicuna_ling_ents_chatbot, llama_ling_ents_chatbot, gpt_ling_ents_chatbot,])
|
227 |
-
|
228 |
# Event Handler for API Key
|
229 |
ling_ents_btn.click(update_api_key, inputs=ling_ents_apikey_input)
|
230 |
|
|
|
|
|
|
|
|
|
|
|
231 |
# Event Handler for GPT 3.5 Chatbot
|
232 |
ling_ents_btn.click(gpt_respond, inputs=[have_key2, linguistic_entities, ling_ents_prompt, gpt_ling_ents_chatbot],
|
233 |
outputs=[ling_ents_prompt, gpt_ling_ents_chatbot])
|
@@ -283,7 +289,7 @@ def interface():
|
|
283 |
task_btn = gr.Button(value="Submit")
|
284 |
|
285 |
# Outputs
|
286 |
-
|
287 |
gr.Markdown("### Strategy 1 - QA-Based Prompting")
|
288 |
strategy1 = gr.Markdown("S1", visible=False)
|
289 |
with gr.Row():
|
@@ -312,10 +318,9 @@ def interface():
|
|
312 |
|
313 |
# Show user's original prompt
|
314 |
def update_textbox(prompt):
|
315 |
-
|
316 |
-
user_prompt.text = prompt
|
317 |
|
318 |
-
task_btn.click(update_textbox, inputs=
|
319 |
|
320 |
# Event Handler for GPT 3.5 Chatbot POS/Chunk, user must submit api key before submitting the prompt
|
321 |
# Will activate after getting API key
|
|
|
216 |
|
217 |
# Outputs
|
218 |
|
219 |
+
user_prompt_1 = gr.Textbox(label="Original prompt")
|
220 |
# linguistic_features_textbox = gr.Textbox(label="Linguistic Features", disabled=True)
|
221 |
|
222 |
with gr.Row():
|
|
|
225 |
vicuna_ling_ents_chatbot = gr.Chatbot(label="vicuna-7b")
|
226 |
clear = gr.ClearButton(components=[ling_ents_prompt, ling_ents_apikey_input, have_key2, linguistic_entities,
|
227 |
vicuna_ling_ents_chatbot, llama_ling_ents_chatbot, gpt_ling_ents_chatbot,])
|
228 |
+
|
229 |
# Event Handler for API Key
|
230 |
ling_ents_btn.click(update_api_key, inputs=ling_ents_apikey_input)
|
231 |
|
232 |
+
def update_textbox(prompt):
|
233 |
+
return prompt
|
234 |
+
|
235 |
+
task_btn.click(fn=update_textbox, inputs=user_prompt_1, outputs=user_prompt_1, api_name="task_btn")
|
236 |
+
|
237 |
# Event Handler for GPT 3.5 Chatbot
|
238 |
ling_ents_btn.click(gpt_respond, inputs=[have_key2, linguistic_entities, ling_ents_prompt, gpt_ling_ents_chatbot],
|
239 |
outputs=[ling_ents_prompt, gpt_ling_ents_chatbot])
|
|
|
289 |
task_btn = gr.Button(value="Submit")
|
290 |
|
291 |
# Outputs
|
292 |
+
user_prompt_2 = gr.Textbox(label="Original prompt", )
|
293 |
gr.Markdown("### Strategy 1 - QA-Based Prompting")
|
294 |
strategy1 = gr.Markdown("S1", visible=False)
|
295 |
with gr.Row():
|
|
|
318 |
|
319 |
# Show user's original prompt
|
320 |
def update_textbox(prompt):
|
321 |
+
return prompt
|
|
|
322 |
|
323 |
+
task_btn.click(fn=update_textbox, inputs=user_prompt_2, outputs=user_prompt_2, api_name="task_btn")
|
324 |
|
325 |
# Event Handler for GPT 3.5 Chatbot POS/Chunk, user must submit api key before submitting the prompt
|
326 |
# Will activate after getting API key
|