Liam Dyer commited on
Commit
dd1cb9c
1 Parent(s): 3197352
Files changed (3) hide show
  1. app.py +17 -0
  2. packages.txt +1 -0
  3. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+
5
+ def convert(file):
6
+ os.system(f"pandoc {file} -t markdown -o output.md")
7
+ with open("output.md", "r") as f:
8
+ return f.read()
9
+
10
+
11
+ gr.Interface(
12
+ fn=convert,
13
+ inputs=[
14
+ gr.File(label="Upload File", type="filepath"),
15
+ ],
16
+ outputs=[gr.Text(label="Markdown")],
17
+ ).launch()
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ pandoc
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ pandoc==2.3