neuralworm commited on
Commit
36f2148
Β·
verified Β·
1 Parent(s): 8e31850

revert to matplotlib

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -9,16 +9,20 @@ with gr.Blocks(title="PSYCHOHISTORY") as app:
9
  btn_search = gr.Button("Look", scale=1)
10
  with gr.Row():
11
  mem_results = gr.JSON(label="Results")
12
- html_output = gr.HTML(label="Graph Visualization") # Use HTML component
13
  btn_search.click(
14
  gen.generate,
15
  inputs=[txt_search],
16
  outputs=mem_results
17
  )
 
 
 
 
 
18
  mem_results.change(
19
  psychohistory.main,
20
  inputs=[mem_results],
21
- outputs=html_output # Output to the HTML component
22
  )
23
 
24
  if __name__ == "__main__":
 
9
  btn_search = gr.Button("Look", scale=1)
10
  with gr.Row():
11
  mem_results = gr.JSON(label="Results")
 
12
  btn_search.click(
13
  gen.generate,
14
  inputs=[txt_search],
15
  outputs=mem_results
16
  )
17
+
18
+ with gr.Row():
19
+ img_output = gr.Image(label="Graph Visualization", type="filepath") # Add an Image component
20
+
21
+ # Trigger graph generation after JSON is generated
22
  mem_results.change(
23
  psychohistory.main,
24
  inputs=[mem_results],
25
+ outputs=img_output
26
  )
27
 
28
  if __name__ == "__main__":