Yoxas commited on
Commit
50d5b5b
·
verified ·
1 Parent(s): a829f61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -103,15 +103,15 @@ def process_pdfs(files):
103
  def gradio_interface(files):
104
  data = process_pdfs([file.name for file in files])
105
  df = pd.DataFrame(data, columns=['Title', 'Abstract', 'Content'])
106
- csv_path = "/content/drive/My Drive/path_to_output/output.csv" # Adjust this to your actual path
107
  df.to_csv(csv_path, index=False)
108
  return csv_path
109
 
110
  # Gradio app setup
111
  gr.Interface(
112
  fn=gradio_interface,
113
- inputs=gr.inputs.File(file_count="multiple", file_types=[".pdf"]),
114
- outputs="text",
115
  title="PDF Research Paper Dataset Creator",
116
  description="Upload PDF research papers to create a dataset with title, abstract, and content."
117
  ).launch()
 
103
  def gradio_interface(files):
104
  data = process_pdfs([file.name for file in files])
105
  df = pd.DataFrame(data, columns=['Title', 'Abstract', 'Content'])
106
+ csv_path = gr.File(label="Download CSV") # Adjust this to your actual path
107
  df.to_csv(csv_path, index=False)
108
  return csv_path
109
 
110
  # Gradio app setup
111
  gr.Interface(
112
  fn=gradio_interface,
113
+ inputs=gr.File(file_count="multiple", file_types=[".pdf"]),
114
+ outputs=csv_output,
115
  title="PDF Research Paper Dataset Creator",
116
  description="Upload PDF research papers to create a dataset with title, abstract, and content."
117
  ).launch()