dromerosm commited on
Commit
f0a1aed
·
verified ·
1 Parent(s): 79bdf7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,13 +2,13 @@ import gradio as gr
2
 
3
  def render_markdown(md_file):
4
  if md_file is not None:
5
- content = md_file.read().decode("utf-8")
6
  return content
7
  return ""
8
 
9
  with gr.Blocks() as demo:
10
  gr.Markdown("## Upload a Markdown file to render it")
11
- file_input = gr.File(label="Upload Markdown File", type="file")
12
  output = gr.Markdown()
13
  file_input.change(fn=render_markdown, inputs=file_input, outputs=output)
14
 
 
2
 
3
  def render_markdown(md_file):
4
  if md_file is not None:
5
+ content = md_file.decode("utf-8")
6
  return content
7
  return ""
8
 
9
  with gr.Blocks() as demo:
10
  gr.Markdown("## Upload a Markdown file to render it")
11
+ file_input = gr.File(label="Upload Markdown File", type="binary")
12
  output = gr.Markdown()
13
  file_input.change(fn=render_markdown, inputs=file_input, outputs=output)
14