Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ from examples import (
|
|
| 21 |
output_example_sf,
|
| 22 |
description_loire,
|
| 23 |
output_example_loire,
|
| 24 |
-
|
| 25 |
)
|
| 26 |
|
| 27 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
|
@@ -202,11 +202,11 @@ def run_display(text):
|
|
| 202 |
yield map, "```text\n" + current_output + "\n```"
|
| 203 |
|
| 204 |
|
| 205 |
-
def select_example(
|
| 206 |
-
|
| 207 |
-
dataframe, _ = parse_llm_output(
|
| 208 |
map = create_map_from_markers(dataframe)
|
| 209 |
-
return
|
| 210 |
|
| 211 |
|
| 212 |
with gr.Blocks(
|
|
@@ -233,8 +233,8 @@ with gr.Blocks(
|
|
| 233 |
button.click(run_display, inputs=[text], outputs=[map, display_thoughts])
|
| 234 |
|
| 235 |
gr.Markdown("### Other examples")
|
| 236 |
-
clickable_examples = gr.
|
| 237 |
-
clickable_examples.
|
| 238 |
select_example, clickable_examples, outputs=[text, map, display_thoughts]
|
| 239 |
)
|
| 240 |
|
|
|
|
| 21 |
output_example_sf,
|
| 22 |
description_loire,
|
| 23 |
output_example_loire,
|
| 24 |
+
trip_examples
|
| 25 |
)
|
| 26 |
|
| 27 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
|
|
|
| 202 |
yield map, "```text\n" + current_output + "\n```"
|
| 203 |
|
| 204 |
|
| 205 |
+
def select_example(choice, data: gr.SelectData):
|
| 206 |
+
output = trip_examples[choice]
|
| 207 |
+
dataframe, _ = parse_llm_output(output)
|
| 208 |
map = create_map_from_markers(dataframe)
|
| 209 |
+
return choice, map, "```text\n" + output + "\n```"
|
| 210 |
|
| 211 |
|
| 212 |
with gr.Blocks(
|
|
|
|
| 233 |
button.click(run_display, inputs=[text], outputs=[map, display_thoughts])
|
| 234 |
|
| 235 |
gr.Markdown("### Other examples")
|
| 236 |
+
clickable_examples = gr.Dropdown(choices=trip_examples.keys())
|
| 237 |
+
clickable_examples.input(
|
| 238 |
select_example, clickable_examples, outputs=[text, map, display_thoughts]
|
| 239 |
)
|
| 240 |
|