Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def run_display(text):
|
|
| 115 |
map = create_map_from_markers(dataframe)
|
| 116 |
return map, rationale
|
| 117 |
|
| 118 |
-
df_examples = pd.DataFrame.from_dict({"description": [description_loire], "output": [output_example_loire]})
|
| 119 |
|
| 120 |
def select_example(df, data: gr.SelectData):
|
| 121 |
row = df.iloc[data.index[0], :]
|
|
@@ -131,7 +131,7 @@ with gr.Blocks(
|
|
| 131 |
) as demo:
|
| 132 |
gr.Markdown("# 🗺️ LLM trip planner (based on Mixtral)")
|
| 133 |
text = gr.Textbox(
|
| 134 |
-
label="
|
| 135 |
value=description_sf,
|
| 136 |
)
|
| 137 |
button = gr.Button()
|
|
@@ -142,10 +142,11 @@ with gr.Blocks(
|
|
| 142 |
display_rationale = gr.Markdown(example_rationale)
|
| 143 |
starting_map = create_map_from_markers(example_dataframe)
|
| 144 |
map = Folium(value=starting_map, height=600, label="Chosen locations")
|
|
|
|
| 145 |
|
|
|
|
| 146 |
clickable_examples = gr.DataFrame(value=df_examples, height=200)
|
| 147 |
clickable_examples.select(select_example, clickable_examples, outputs=[map, display_rationale])
|
| 148 |
-
button.click(run_display, inputs=[text], outputs=[map, display_rationale])
|
| 149 |
|
| 150 |
if __name__ == "__main__":
|
| 151 |
demo.launch()
|
|
|
|
| 115 |
map = create_map_from_markers(dataframe)
|
| 116 |
return map, rationale
|
| 117 |
|
| 118 |
+
df_examples = pd.DataFrame.from_dict({"description": [description_loire, description_sf], "output": [output_example_loire, output_example_sf]})
|
| 119 |
|
| 120 |
def select_example(df, data: gr.SelectData):
|
| 121 |
row = df.iloc[data.index[0], :]
|
|
|
|
| 131 |
) as demo:
|
| 132 |
gr.Markdown("# 🗺️ LLM trip planner (based on Mixtral)")
|
| 133 |
text = gr.Textbox(
|
| 134 |
+
label="Describe your trip here:",
|
| 135 |
value=description_sf,
|
| 136 |
)
|
| 137 |
button = gr.Button()
|
|
|
|
| 142 |
display_rationale = gr.Markdown(example_rationale)
|
| 143 |
starting_map = create_map_from_markers(example_dataframe)
|
| 144 |
map = Folium(value=starting_map, height=600, label="Chosen locations")
|
| 145 |
+
button.click(run_display, inputs=[text], outputs=[map, display_rationale])
|
| 146 |
|
| 147 |
+
gr.Markdown("### Examples")
|
| 148 |
clickable_examples = gr.DataFrame(value=df_examples, height=200)
|
| 149 |
clickable_examples.select(select_example, clickable_examples, outputs=[map, display_rationale])
|
|
|
|
| 150 |
|
| 151 |
if __name__ == "__main__":
|
| 152 |
demo.launch()
|