Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 = "
|
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.
|
114 |
-
outputs=
|
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()
|