Update app.py
Browse files
app.py
CHANGED
@@ -35,11 +35,19 @@ def get_random_row():
|
|
35 |
return (instruction, responses[0][1], responses[1][1],
|
36 |
responses[0][0], responses[1][0], pair_name)
|
37 |
|
38 |
-
def
|
39 |
return f'''
|
40 |
<div style="border: 1px solid white; background-color: black;
|
41 |
padding: 10px; margin: 5px;">
|
42 |
-
<strong style="color: white;">Answer:</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
<div style="color: white;">{response}</div>
|
44 |
</div>
|
45 |
'''
|
@@ -70,8 +78,8 @@ def submit_choice(selected_response, instruction, label_1, label_2, pair_name):
|
|
70 |
|
71 |
return (
|
72 |
f"### Question:\n{new_instruction}",
|
73 |
-
|
74 |
-
|
75 |
new_label_1,
|
76 |
new_label_2,
|
77 |
new_pair_name,
|
@@ -83,7 +91,7 @@ def create_interface():
|
|
83 |
|
84 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
85 |
gr.Markdown("# Human-Likeness Voting System")
|
86 |
-
gr.Markdown("![
|
87 |
gr.Markdown("This interface has been created to compare the performance of the human-like LLMs developed by our team with the models on which they were trained. The results of this study will be presented in a paper. Please ensure that your responses are fair and accurate when casting your vote and selecting the appropriate answer. We thank you for your contributions on behalf of the research team.")
|
88 |
gr.Markdown("## Instructions")
|
89 |
gr.Markdown(
|
@@ -99,9 +107,9 @@ def create_interface():
|
|
99 |
question_display = gr.Markdown(value=f"### Question:\n{instruction}")
|
100 |
with gr.Row():
|
101 |
with gr.Column():
|
102 |
-
response_1_display = gr.HTML(
|
103 |
with gr.Column():
|
104 |
-
response_2_display = gr.HTML(
|
105 |
with gr.Row():
|
106 |
selected_response = gr.Radio(
|
107 |
["Answer 1", "Answer 2"],
|
|
|
35 |
return (instruction, responses[0][1], responses[1][1],
|
36 |
responses[0][0], responses[1][0], pair_name)
|
37 |
|
38 |
+
def format_response_1_html(response):
|
39 |
return f'''
|
40 |
<div style="border: 1px solid white; background-color: black;
|
41 |
padding: 10px; margin: 5px;">
|
42 |
+
<strong style="color: white;">Answer 1:</strong>
|
43 |
+
<div style="color: white;">{response}</div>
|
44 |
+
</div>
|
45 |
+
'''
|
46 |
+
def format_response_2_html(response):
|
47 |
+
return f'''
|
48 |
+
<div style="border: 1px solid white; background-color: black;
|
49 |
+
padding: 10px; margin: 5px;">
|
50 |
+
<strong style="color: white;">Answer 2:</strong>
|
51 |
<div style="color: white;">{response}</div>
|
52 |
</div>
|
53 |
'''
|
|
|
78 |
|
79 |
return (
|
80 |
f"### Question:\n{new_instruction}",
|
81 |
+
format_response_1_html(new_response_1),
|
82 |
+
format_response_2_html(new_response_2),
|
83 |
new_label_1,
|
84 |
new_label_2,
|
85 |
new_pair_name,
|
|
|
91 |
|
92 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
93 |
gr.Markdown("# Human-Likeness Voting System")
|
94 |
+
gr.Markdown("![logo](logo.png)")
|
95 |
gr.Markdown("This interface has been created to compare the performance of the human-like LLMs developed by our team with the models on which they were trained. The results of this study will be presented in a paper. Please ensure that your responses are fair and accurate when casting your vote and selecting the appropriate answer. We thank you for your contributions on behalf of the research team.")
|
96 |
gr.Markdown("## Instructions")
|
97 |
gr.Markdown(
|
|
|
107 |
question_display = gr.Markdown(value=f"### Question:\n{instruction}")
|
108 |
with gr.Row():
|
109 |
with gr.Column():
|
110 |
+
response_1_display = gr.HTML(format_response_1_html(response_1))
|
111 |
with gr.Column():
|
112 |
+
response_2_display = gr.HTML(format_response_2_html(response_2))
|
113 |
with gr.Row():
|
114 |
selected_response = gr.Radio(
|
115 |
["Answer 1", "Answer 2"],
|