Spaces:
Sleeping
Sleeping
research14
commited on
Commit
•
f690e36
1
Parent(s):
adf3921
reordered models: gpt, llama, vicuna
Browse files
app.py
CHANGED
@@ -216,21 +216,21 @@ def interface():
|
|
216 |
gr.Markdown("### Strategy 1 - QA-Based Prompting")
|
217 |
strategy1 = gr.Markdown("S1", visible=False)
|
218 |
with gr.Row():
|
219 |
-
vicuna_S1_chatbot = gr.Chatbot(label="vicuna-7b")
|
220 |
-
llama_S1_chatbot = gr.Chatbot(label="llama-7b")
|
221 |
gpt_S1_chatbot = gr.Chatbot(label="gpt-3.5")
|
|
|
|
|
222 |
gr.Markdown("### Strategy 2 - Instruction-Based Prompting")
|
223 |
strategy2 = gr.Markdown("S2", visible=False)
|
224 |
with gr.Row():
|
225 |
-
vicuna_S2_chatbot = gr.Chatbot(label="vicuna-7b")
|
226 |
-
llama_S2_chatbot = gr.Chatbot(label="llama-7b")
|
227 |
gpt_S2_chatbot = gr.Chatbot(label="gpt-3.5")
|
|
|
|
|
228 |
gr.Markdown("### Strategy 3 - Structured Prompting")
|
229 |
strategy3 = gr.Markdown("S3", visible=False)
|
230 |
with gr.Row():
|
231 |
-
vicuna_S3_chatbot = gr.Chatbot(label="vicuna-7b")
|
232 |
-
llama_S3_chatbot = gr.Chatbot(label="llama-7b")
|
233 |
gpt_S3_chatbot = gr.Chatbot(label="gpt-3.5")
|
|
|
|
|
234 |
clear_all = gr.ClearButton(components=[task_prompt, task_apikey_input, have_key, task, task_linguistic_entities,
|
235 |
vicuna_S1_chatbot, llama_S1_chatbot, gpt_S1_chatbot,
|
236 |
vicuna_S2_chatbot, llama_S2_chatbot, gpt_S2_chatbot,
|
@@ -238,24 +238,7 @@ def interface():
|
|
238 |
|
239 |
# Event Handler for API Key
|
240 |
task_btn.click(update_api_key, inputs=task_apikey_input)
|
241 |
-
|
242 |
-
# vicuna_strategies_respond(strategy, task_name, task_ling_ent, message, chat_history):
|
243 |
-
# Event Handlers for Vicuna Chatbot POS/Chunk
|
244 |
-
task_btn.click(vicuna_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, task_prompt, vicuna_S1_chatbot],
|
245 |
-
outputs=[task, task_prompt, vicuna_S1_chatbot])
|
246 |
-
task_btn.click(vicuna_strategies_respond, inputs=[strategy2, task, task_linguistic_entities, task_prompt, vicuna_S2_chatbot],
|
247 |
-
outputs=[task, task_prompt, vicuna_S2_chatbot])
|
248 |
-
task_btn.click(vicuna_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, vicuna_S3_chatbot],
|
249 |
-
outputs=[task, task_prompt, vicuna_S3_chatbot])
|
250 |
-
|
251 |
-
# Event Handler for LLaMA Chatbot POS/Chunk
|
252 |
-
task_btn.click(llama_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, task_prompt, llama_S1_chatbot],
|
253 |
-
outputs=[task, task_prompt, llama_S1_chatbot])
|
254 |
-
task_btn.click(llama_strategies_respond, inputs=[strategy2, task, task_linguistic_entities, task_prompt, llama_S2_chatbot],
|
255 |
-
outputs=[task, task_prompt, llama_S2_chatbot])
|
256 |
-
task_btn.click(llama_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, llama_S3_chatbot],
|
257 |
-
outputs=[task, task_prompt, llama_S3_chatbot])
|
258 |
-
|
259 |
# Event Handler for GPT 3.5 Chatbot POS/Chunk, user must submit api key before submitting the prompt
|
260 |
# Will activate after getting API key
|
261 |
# task_apikey_btn.click(update_api_key, inputs=ling_ents_apikey_input)
|
@@ -265,8 +248,23 @@ def interface():
|
|
265 |
outputs=[task_prompt, gpt_S2_chatbot])
|
266 |
task_btn.click(gpt_strategies_respond, inputs=[have_key, strategy3, task, task_linguistic_entities, task_prompt, gpt_S3_chatbot],
|
267 |
outputs=[task_prompt, gpt_S3_chatbot])
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
272 |
gr.Markdown("""
|
|
|
216 |
gr.Markdown("### Strategy 1 - QA-Based Prompting")
|
217 |
strategy1 = gr.Markdown("S1", visible=False)
|
218 |
with gr.Row():
|
|
|
|
|
219 |
gpt_S1_chatbot = gr.Chatbot(label="gpt-3.5")
|
220 |
+
llama_S1_chatbot = gr.Chatbot(label="llama-7b")
|
221 |
+
vicuna_S1_chatbot = gr.Chatbot(label="vicuna-7b")
|
222 |
gr.Markdown("### Strategy 2 - Instruction-Based Prompting")
|
223 |
strategy2 = gr.Markdown("S2", visible=False)
|
224 |
with gr.Row():
|
|
|
|
|
225 |
gpt_S2_chatbot = gr.Chatbot(label="gpt-3.5")
|
226 |
+
llama_S2_chatbot = gr.Chatbot(label="llama-7b")
|
227 |
+
vicuna_S2_chatbot = gr.Chatbot(label="vicuna-7b")
|
228 |
gr.Markdown("### Strategy 3 - Structured Prompting")
|
229 |
strategy3 = gr.Markdown("S3", visible=False)
|
230 |
with gr.Row():
|
|
|
|
|
231 |
gpt_S3_chatbot = gr.Chatbot(label="gpt-3.5")
|
232 |
+
llama_S3_chatbot = gr.Chatbot(label="llama-7b")
|
233 |
+
vicuna_S3_chatbot = gr.Chatbot(label="vicuna-7b")
|
234 |
clear_all = gr.ClearButton(components=[task_prompt, task_apikey_input, have_key, task, task_linguistic_entities,
|
235 |
vicuna_S1_chatbot, llama_S1_chatbot, gpt_S1_chatbot,
|
236 |
vicuna_S2_chatbot, llama_S2_chatbot, gpt_S2_chatbot,
|
|
|
238 |
|
239 |
# Event Handler for API Key
|
240 |
task_btn.click(update_api_key, inputs=task_apikey_input)
|
241 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
# Event Handler for GPT 3.5 Chatbot POS/Chunk, user must submit api key before submitting the prompt
|
243 |
# Will activate after getting API key
|
244 |
# task_apikey_btn.click(update_api_key, inputs=ling_ents_apikey_input)
|
|
|
248 |
outputs=[task_prompt, gpt_S2_chatbot])
|
249 |
task_btn.click(gpt_strategies_respond, inputs=[have_key, strategy3, task, task_linguistic_entities, task_prompt, gpt_S3_chatbot],
|
250 |
outputs=[task_prompt, gpt_S3_chatbot])
|
251 |
+
|
252 |
+
# Event Handler for LLaMA Chatbot POS/Chunk
|
253 |
+
task_btn.click(llama_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, task_prompt, llama_S1_chatbot],
|
254 |
+
outputs=[task, task_prompt, llama_S1_chatbot])
|
255 |
+
task_btn.click(llama_strategies_respond, inputs=[strategy2, task, task_linguistic_entities, task_prompt, llama_S2_chatbot],
|
256 |
+
outputs=[task, task_prompt, llama_S2_chatbot])
|
257 |
+
task_btn.click(llama_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, llama_S3_chatbot],
|
258 |
+
outputs=[task, task_prompt, llama_S3_chatbot])
|
259 |
+
|
260 |
+
# vicuna_strategies_respond(strategy, task_name, task_ling_ent, message, chat_history):
|
261 |
+
# Event Handlers for Vicuna Chatbot POS/Chunk
|
262 |
+
task_btn.click(vicuna_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, task_prompt, vicuna_S1_chatbot],
|
263 |
+
outputs=[task, task_prompt, vicuna_S1_chatbot])
|
264 |
+
task_btn.click(vicuna_strategies_respond, inputs=[strategy2, task, task_linguistic_entities, task_prompt, vicuna_S2_chatbot],
|
265 |
+
outputs=[task, task_prompt, vicuna_S2_chatbot])
|
266 |
+
task_btn.click(vicuna_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, vicuna_S3_chatbot],
|
267 |
+
outputs=[task, task_prompt, vicuna_S3_chatbot])
|
268 |
|
269 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
270 |
gr.Markdown("""
|