Update app.py
Browse files
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.
|
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="
|
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 |
|