Liam Dyer commited on
Commit
4013f70
1 Parent(s): 6c400a9

feat: add metadata param

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -76,16 +76,19 @@ def convert(input_file):
76
  # Already a plain text file that wouldn't benefit from pandoc so return the content
77
  if any(input_file.endswith(ft) for ft in plain_text_filetypes):
78
  with open(input_file, "r") as f:
79
- return f.read()
80
 
81
  if input_file.endswith(".pdf"):
82
  return convert_pdf(input_file)
83
 
84
- return convert_pandoc(input_file)
85
 
86
 
87
  gr.Interface(
88
  convert,
89
  inputs=gr.File(label="Upload File", type="filepath"),
90
- outputs=gr.Text(label="Markdown"),
 
 
 
91
  ).launch()
 
76
  # Already a plain text file that wouldn't benefit from pandoc so return the content
77
  if any(input_file.endswith(ft) for ft in plain_text_filetypes):
78
  with open(input_file, "r") as f:
79
+ return f.read(), {}
80
 
81
  if input_file.endswith(".pdf"):
82
  return convert_pdf(input_file)
83
 
84
+ return convert_pandoc(input_file), {}
85
 
86
 
87
  gr.Interface(
88
  convert,
89
  inputs=gr.File(label="Upload File", type="filepath"),
90
+ outputs=[
91
+ gr.Text(label="Markdown"),
92
+ gr.JSON(label="Metadata"),
93
+ ],
94
  ).launch()