Spaces:
Sleeping
Sleeping
research14
commited on
Commit
•
edb0bcd
1
Parent(s):
7f877a9
test more strategies
Browse files
app.py
CHANGED
@@ -8,9 +8,25 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
8 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
9 |
|
10 |
with gr.Blocks() as demo:
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def respond(message, chat_history):
|
16 |
input_ids = tokenizer.encode(message, return_tensors="pt")
|
@@ -21,6 +37,8 @@ with gr.Blocks() as demo:
|
|
21 |
time.sleep(2)
|
22 |
return "", chat_history
|
23 |
|
24 |
-
msg.submit(respond, [msg,
|
|
|
|
|
25 |
|
26 |
demo.launch()
|
|
|
8 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
9 |
|
10 |
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("# LLM Evaluator With Linguistic Scrutiny")
|
12 |
+
|
13 |
+
with gr.Tab("POS"):
|
14 |
+
gr.Markdown(" Description ")
|
15 |
+
|
16 |
+
msg = gr.Textbox(show_label=False, placeholder="Write a prompt and press enter")
|
17 |
+
|
18 |
+
gr.Markdown("Strategy 1 QA")
|
19 |
+
with gr.Row():
|
20 |
+
vicuna_S1_chatbot_POS = gr.Chatbot(label="vicuna-7b")
|
21 |
+
clear = gr.ClearButton([msg, vicuna_S1_chatbot_POS])
|
22 |
+
gr.Markdown("Strategy 2 Instruction")
|
23 |
+
with gr.Row():
|
24 |
+
vicuna_S2_chatbot_POS = gr.Chatbot(label="vicuna-7b")
|
25 |
+
clear = gr.ClearButton([msg, vicuna_S2_chatbot_POS])
|
26 |
+
gr.Markdown("Strategy 1 Structured Prompting")
|
27 |
+
with gr.Row():
|
28 |
+
vicuna_S3_chatbot_POS = gr.Chatbot(label="vicuna-7b")
|
29 |
+
clear = gr.ClearButton([msg, vicuna_S3_chatbot_POS])
|
30 |
|
31 |
def respond(message, chat_history):
|
32 |
input_ids = tokenizer.encode(message, return_tensors="pt")
|
|
|
37 |
time.sleep(2)
|
38 |
return "", chat_history
|
39 |
|
40 |
+
msg.submit(respond, [msg, vicuna_S1_chatbot_POS], [msg, vicuna_S1_chatbot_POS])
|
41 |
+
msg.submit(respond, [msg, vicuna_S2_chatbot_POS], [msg, vicuna_S2_chatbot_POS])
|
42 |
+
msg.submit(respond, [msg, vicuna_S3_chatbot_POS], [msg, vicuna_S3_chatbot_POS])
|
43 |
|
44 |
demo.launch()
|