Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,27 @@ COLS_LITE = [c.name for c in fields(AutoEvalColumn) if c.displayed_by_default an
|
|
27 |
TYPES_LITE = [c.type for c in fields(AutoEvalColumn) if c.displayed_by_default and not c.hidden]
|
28 |
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
def select_columns(df, columns):
|
31 |
always_here_cols = [
|
32 |
AutoEvalColumn.model.name
|
@@ -123,6 +144,9 @@ with demo:
|
|
123 |
width=500,
|
124 |
)
|
125 |
|
|
|
|
|
|
|
126 |
with gr.Column():
|
127 |
gr.Markdown(
|
128 |
"""<div style="text-align: center;"><h2> 🤖ConvRe🤯 Demo </h2></div>\
|
@@ -135,17 +159,12 @@ with demo:
|
|
135 |
|
136 |
input_box = gr.Textbox(lines=12, max_lines=12, label="Input")
|
137 |
|
138 |
-
with gr.Row():
|
139 |
-
gr.ClearButton([input_box, output_box])
|
140 |
-
gr.Button("Submit")
|
141 |
-
|
142 |
with gr.Row():
|
143 |
re2text_easy_btn = gr.Button("Random Re2Text Easy Example 😄")
|
144 |
re2text_easy_btn.click(
|
145 |
fn=random_examples,
|
146 |
inputs=gr.Text("re2text-easy", visible=False),
|
147 |
outputs = input_box,
|
148 |
-
api_name="re2text-easy"
|
149 |
)
|
150 |
|
151 |
re2text_hard_btn = gr.Button("Random Re2Text Hard Example 🤯")
|
@@ -170,7 +189,7 @@ with demo:
|
|
170 |
)
|
171 |
|
172 |
with gr.Accordion("Additional Inputs", open=False):
|
173 |
-
gr.Textbox(label="System prompt", value=DEFAULT_SYSTEM_PROMPT, lines=6)
|
174 |
|
175 |
gr.Slider(
|
176 |
label="Max new tokens",
|
@@ -178,7 +197,7 @@ with demo:
|
|
178 |
maximum=MAX_MAX_NEW_TOKENS,
|
179 |
step=1,
|
180 |
value=DEFAULT_MAX_NEW_TOKENS,
|
181 |
-
)
|
182 |
|
183 |
gr.Slider(
|
184 |
label="Temperature",
|
@@ -186,6 +205,11 @@ with demo:
|
|
186 |
maximum=4.0,
|
187 |
step=0.05,
|
188 |
value=0,
|
189 |
-
)
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
demo.launch()
|
|
|
27 |
TYPES_LITE = [c.type for c in fields(AutoEvalColumn) if c.displayed_by_default and not c.hidden]
|
28 |
|
29 |
|
30 |
+
def add_new_eval(
|
31 |
+
model: str,
|
32 |
+
re2text_easy_precision: str,
|
33 |
+
re2text_hard_precision: str,
|
34 |
+
text2re_easy_precision: str,
|
35 |
+
text2re_hard_precision: str,
|
36 |
+
links: str,
|
37 |
+
):
|
38 |
+
print("adding new eval")
|
39 |
+
|
40 |
+
eval_entry = {
|
41 |
+
"model": model,
|
42 |
+
"re2text_easy": re2text_easy_precision,
|
43 |
+
"re2text_hard": re2text_hard_precision,
|
44 |
+
"text2re_easy": text2re_easy_precision,
|
45 |
+
"text2re_hard": text2re_hard_precision,
|
46 |
+
"link": links
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
def select_columns(df, columns):
|
52 |
always_here_cols = [
|
53 |
AutoEvalColumn.model.name
|
|
|
144 |
width=500,
|
145 |
)
|
146 |
|
147 |
+
with gr.TabItem("Submit results 🚀", id=3):
|
148 |
+
gr.Markdown("Submit Here")
|
149 |
+
|
150 |
with gr.Column():
|
151 |
gr.Markdown(
|
152 |
"""<div style="text-align: center;"><h2> 🤖ConvRe🤯 Demo </h2></div>\
|
|
|
159 |
|
160 |
input_box = gr.Textbox(lines=12, max_lines=12, label="Input")
|
161 |
|
|
|
|
|
|
|
|
|
162 |
with gr.Row():
|
163 |
re2text_easy_btn = gr.Button("Random Re2Text Easy Example 😄")
|
164 |
re2text_easy_btn.click(
|
165 |
fn=random_examples,
|
166 |
inputs=gr.Text("re2text-easy", visible=False),
|
167 |
outputs = input_box,
|
|
|
168 |
)
|
169 |
|
170 |
re2text_hard_btn = gr.Button("Random Re2Text Hard Example 🤯")
|
|
|
189 |
)
|
190 |
|
191 |
with gr.Accordion("Additional Inputs", open=False):
|
192 |
+
sys_prompt = gr.Textbox(label="System prompt", value=DEFAULT_SYSTEM_PROMPT, lines=6)
|
193 |
|
194 |
gr.Slider(
|
195 |
label="Max new tokens",
|
|
|
197 |
maximum=MAX_MAX_NEW_TOKENS,
|
198 |
step=1,
|
199 |
value=DEFAULT_MAX_NEW_TOKENS,
|
200 |
+
)
|
201 |
|
202 |
gr.Slider(
|
203 |
label="Temperature",
|
|
|
205 |
maximum=4.0,
|
206 |
step=0.05,
|
207 |
value=0,
|
208 |
+
)
|
209 |
+
|
210 |
+
with gr.Row():
|
211 |
+
gr.ClearButton([input_box, output_box])
|
212 |
+
submit_btn = gr.Button("Submit")
|
213 |
+
submit_btn.click(generate, inputs=[input_box, sys_prompt], outputs=[output_box])
|
214 |
|
215 |
demo.launch()
|