Spaces:
Sleeping
Sleeping
Allen Park
commited on
Commit
·
1c92944
1
Parent(s):
50d1738
add spacing for example header & make examples fill in rows (not one per row)
Browse files
app.py
CHANGED
@@ -96,7 +96,9 @@ HEADER = """
|
|
96 |
"""
|
97 |
|
98 |
EXAMPLES_HEADER = """
|
|
|
99 |
# Try it Yourself!
|
|
|
100 |
"""
|
101 |
|
102 |
UPLOADABLE_FILE_TYPES = [".pdf", ".txt", ".docx", ".doc"]
|
@@ -228,14 +230,13 @@ with gr.Blocks(css=css, theme=gr.themes.Default(spacing_size="sm", font=[gr.them
|
|
228 |
score = gr.Textbox(label="Score (FAIL if Hallucinated, PASS if not)")
|
229 |
gr.Markdown(EXAMPLES_HEADER)
|
230 |
with gr.Row():
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
)
|
239 |
|
240 |
model_dropdown.change(fn=update_client_base_url, inputs=[model_dropdown], outputs=[base_url_state])
|
241 |
u.upload(upload_file, u, [u, file_group, file_name, document])
|
|
|
96 |
"""
|
97 |
|
98 |
EXAMPLES_HEADER = """
|
99 |
+
|
100 |
# Try it Yourself!
|
101 |
+
|
102 |
"""
|
103 |
|
104 |
UPLOADABLE_FILE_TYPES = [".pdf", ".txt", ".docx", ".doc"]
|
|
|
230 |
score = gr.Textbox(label="Score (FAIL if Hallucinated, PASS if not)")
|
231 |
gr.Markdown(EXAMPLES_HEADER)
|
232 |
with gr.Row():
|
233 |
+
for _, example in enumerate(EXAMPLES):
|
234 |
+
template_btn = gr.Button(f"{example['emoji']} {example['question']}", elem_classes="example-button")
|
235 |
+
template_btn.click(
|
236 |
+
fn=select_template,
|
237 |
+
inputs=[gr.State(example)],
|
238 |
+
outputs=[question, document, answer]
|
239 |
+
)
|
|
|
240 |
|
241 |
model_dropdown.change(fn=update_client_base_url, inputs=[model_dropdown], outputs=[base_url_state])
|
242 |
u.upload(upload_file, u, [u, file_group, file_name, document])
|