Spaces:
Runtime error
Runtime error
Commit
·
5cdbb3f
1
Parent(s):
2444964
Test
Browse files
app.py
CHANGED
|
@@ -60,7 +60,7 @@ def respond(message, chat_history):
|
|
| 60 |
time.sleep(2)
|
| 61 |
return "", chat_history
|
| 62 |
|
| 63 |
-
def interface(
|
| 64 |
gr.Markdown(" Description ")
|
| 65 |
|
| 66 |
textbox_prompt = gr.Textbox(show_label=False, placeholder="Write a prompt and press enter")
|
|
@@ -69,6 +69,8 @@ def interface(tab_name):
|
|
| 69 |
|
| 70 |
prompt = template_single.format(tab_name, textbox_prompt)
|
| 71 |
|
|
|
|
|
|
|
| 72 |
gr.Markdown("Strategy 1 QA-Based Prompting")
|
| 73 |
with gr.Row():
|
| 74 |
vicuna_S1_chatbot = gr.Chatbot(label="vicuna-7b")
|
|
@@ -98,7 +100,7 @@ with gr.Blocks() as demo:
|
|
| 98 |
gr.Markdown("# LLM Evaluator With Linguistic Scrutiny")
|
| 99 |
|
| 100 |
with gr.Tab("Noun"):
|
| 101 |
-
interface(
|
| 102 |
|
| 103 |
with gr.Tab("Determiner"):
|
| 104 |
gr.Markdown(" Description ")
|
|
@@ -125,13 +127,13 @@ with gr.Blocks() as demo:
|
|
| 125 |
clear = gr.ClearButton([prompt_CHUNK, vicuna_S3_chatbot_CHUNK])
|
| 126 |
|
| 127 |
with gr.Tab("Noun phrase"):
|
| 128 |
-
interface(
|
| 129 |
with gr.Tab("Verb phrase"):
|
| 130 |
-
interface(
|
| 131 |
with gr.Tab("Dependent clause"):
|
| 132 |
-
interface(
|
| 133 |
with gr.Tab("T-units"):
|
| 134 |
-
interface(
|
| 135 |
|
| 136 |
prompt_CHUNK.submit(respond, [prompt_CHUNK, vicuna_S1_chatbot_CHUNK], [prompt_CHUNK, vicuna_S1_chatbot_CHUNK])
|
| 137 |
prompt_CHUNK.submit(respond, [prompt_CHUNK, vicuna_S2_chatbot_CHUNK], [prompt_CHUNK, vicuna_S2_chatbot_CHUNK])
|
|
|
|
| 60 |
time.sleep(2)
|
| 61 |
return "", chat_history
|
| 62 |
|
| 63 |
+
def interface():
|
| 64 |
gr.Markdown(" Description ")
|
| 65 |
|
| 66 |
textbox_prompt = gr.Textbox(show_label=False, placeholder="Write a prompt and press enter")
|
|
|
|
| 69 |
|
| 70 |
prompt = template_single.format(tab_name, textbox_prompt)
|
| 71 |
|
| 72 |
+
tab_name = gr.Dropdown(["Noun", "Determiner", "Noun phrase", "Verb phrase", "Dependent clause", "T-units"], label="Linguistic Entity")
|
| 73 |
+
|
| 74 |
gr.Markdown("Strategy 1 QA-Based Prompting")
|
| 75 |
with gr.Row():
|
| 76 |
vicuna_S1_chatbot = gr.Chatbot(label="vicuna-7b")
|
|
|
|
| 100 |
gr.Markdown("# LLM Evaluator With Linguistic Scrutiny")
|
| 101 |
|
| 102 |
with gr.Tab("Noun"):
|
| 103 |
+
interface()
|
| 104 |
|
| 105 |
with gr.Tab("Determiner"):
|
| 106 |
gr.Markdown(" Description ")
|
|
|
|
| 127 |
clear = gr.ClearButton([prompt_CHUNK, vicuna_S3_chatbot_CHUNK])
|
| 128 |
|
| 129 |
with gr.Tab("Noun phrase"):
|
| 130 |
+
interface()
|
| 131 |
with gr.Tab("Verb phrase"):
|
| 132 |
+
interface()
|
| 133 |
with gr.Tab("Dependent clause"):
|
| 134 |
+
interface()
|
| 135 |
with gr.Tab("T-units"):
|
| 136 |
+
interface()
|
| 137 |
|
| 138 |
prompt_CHUNK.submit(respond, [prompt_CHUNK, vicuna_S1_chatbot_CHUNK], [prompt_CHUNK, vicuna_S1_chatbot_CHUNK])
|
| 139 |
prompt_CHUNK.submit(respond, [prompt_CHUNK, vicuna_S2_chatbot_CHUNK], [prompt_CHUNK, vicuna_S2_chatbot_CHUNK])
|