raannakasturi commited on
Commit
c7bbcef
·
verified ·
1 Parent(s): 0536e96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,10 +5,10 @@ import subprocess
5
 
6
  def generate(mindmap_markdown):
7
  mindmap_svg, mindmap_pdf = generate_mindmap(mindmap_markdown)
8
- with open(mindmap_svg, 'wb') as f:
9
  svg_mindmap = f.read()
10
- with open(mindmap_pdf, 'wb') as f:
11
- pdf_mindmap = f.read
12
  return str(svg_mindmap), str(pdf_mindmap)
13
 
14
  theme = gr.themes.Soft(
@@ -22,11 +22,11 @@ with gr.Blocks(theme=theme, title="Binary Biology") as app:
22
  with gr.Row():
23
  with gr.Column():
24
  mindmap_markdown = gr.Textbox(label="Mindmap Markdown", placeholder="Enter the markdown for the mindmap", lines=10)
25
- generate_mindmap = gr.Button(value="Generate Mindmap")
26
  with gr.Column():
27
  svg_mindmap = gr.TextArea(label="SVG Mindmap", placeholder="The SVG representation of the mindmap", lines=10)
28
  pdf_mindmap = gr.TextArea(label="PDF Mindmap", placeholder="The PDF representation of the mindmap", lines=10)
29
- generate_mindmap.click(generate, inputs=[mindmap_markdown], outputs=[svg_mindmap, pdf_mindmap])
30
 
31
  if __name__ == "__main__":
32
  try:
 
5
 
6
  def generate(mindmap_markdown):
7
  mindmap_svg, mindmap_pdf = generate_mindmap(mindmap_markdown)
8
+ with open(mindmap_svg, 'rb') as f:
9
  svg_mindmap = f.read()
10
+ with open(mindmap_pdf, 'rb') as f:
11
+ pdf_mindmap = f.read()
12
  return str(svg_mindmap), str(pdf_mindmap)
13
 
14
  theme = gr.themes.Soft(
 
22
  with gr.Row():
23
  with gr.Column():
24
  mindmap_markdown = gr.Textbox(label="Mindmap Markdown", placeholder="Enter the markdown for the mindmap", lines=10)
25
+ btn_generate_mindmap = gr.Button(value="Generate Mindmap") # Renamed button here
26
  with gr.Column():
27
  svg_mindmap = gr.TextArea(label="SVG Mindmap", placeholder="The SVG representation of the mindmap", lines=10)
28
  pdf_mindmap = gr.TextArea(label="PDF Mindmap", placeholder="The PDF representation of the mindmap", lines=10)
29
+ btn_generate_mindmap.click(generate, inputs=[mindmap_markdown], outputs=[svg_mindmap, pdf_mindmap])
30
 
31
  if __name__ == "__main__":
32
  try: