pratikshahp commited on
Commit
d462865
·
verified ·
1 Parent(s): 258e8da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -73,8 +73,13 @@ def process_disaster(disaster_type, severity, resources):
73
  # Generate Mermaid code for graph visualization
74
  mermaid_code = graph.get_graph().draw_mermaid()
75
 
76
- # Return the response plan and mermaid code
77
- return result["recommendation"], f"```mermaid\n{mermaid_code}\n```"
 
 
 
 
 
78
 
79
  iface = gr.Interface(
80
  fn=process_disaster,
@@ -100,11 +105,11 @@ iface = gr.Interface(
100
  ],
101
  outputs=[
102
  gr.Textbox(label="Generated Disaster Response Plan"),
103
- gr.Markdown("## Mermaid Graph"),
104
- gr.Markdown("Check out this [mermaid link](https://mermaid.live/) to display a graph with the following data"),
105
- gr.Markdown(label="Mermaid Graph Visualization")
106
  ],
107
  title="Disaster Response Assistant",
108
  )
109
 
110
- iface.launch()
 
73
  # Generate Mermaid code for graph visualization
74
  mermaid_code = graph.get_graph().draw_mermaid()
75
 
76
+ # Return the response plan, placeholder markdown, the link, and the Mermaid visualization
77
+ return (
78
+ result["recommendation"],
79
+ "## Mermaid Graph",
80
+ "Check out this [mermaid link](https://mermaid.live/) to display a graph with the following data",
81
+ f"```mermaid\n{mermaid_code}\n```"
82
+ )
83
 
84
  iface = gr.Interface(
85
  fn=process_disaster,
 
105
  ],
106
  outputs=[
107
  gr.Textbox(label="Generated Disaster Response Plan"),
108
+ gr.Markdown(), # Placeholder for the "Mermaid Graph" heading
109
+ gr.Markdown(), # Placeholder for the link text
110
+ gr.Markdown(label="Mermaid Graph Visualization") # Mermaid visualization
111
  ],
112
  title="Disaster Response Assistant",
113
  )
114
 
115
+ iface.launch()