Spaces:
Sleeping
Sleeping
Update BHEL.py
Browse files
BHEL.py
CHANGED
|
@@ -54,7 +54,7 @@ def extract_data(pdf_file):
|
|
| 54 |
|
| 55 |
# Convert data to DataFrame and save as Excel
|
| 56 |
df = pd.DataFrame(data, columns=columns)
|
| 57 |
-
excel_path = "
|
| 58 |
df.to_excel(excel_path, index=False)
|
| 59 |
return excel_path
|
| 60 |
|
|
@@ -98,7 +98,7 @@ def gradio_interface(pdf_file):
|
|
| 98 |
return extract_data(pdf_file.name)
|
| 99 |
|
| 100 |
# Define Gradio interface
|
| 101 |
-
|
| 102 |
fn=gradio_interface,
|
| 103 |
inputs=gr.File(label="Upload PDF"),
|
| 104 |
outputs=gr.File(label="Download Extracted Excel"),
|
|
@@ -107,4 +107,4 @@ interface = gr.Interface(
|
|
| 107 |
)
|
| 108 |
|
| 109 |
if __name__ == "__main__":
|
| 110 |
-
|
|
|
|
| 54 |
|
| 55 |
# Convert data to DataFrame and save as Excel
|
| 56 |
df = pd.DataFrame(data, columns=columns)
|
| 57 |
+
excel_path = "BHEL_Output.xlsx"
|
| 58 |
df.to_excel(excel_path, index=False)
|
| 59 |
return excel_path
|
| 60 |
|
|
|
|
| 98 |
return extract_data(pdf_file.name)
|
| 99 |
|
| 100 |
# Define Gradio interface
|
| 101 |
+
iface = gr.Interface(
|
| 102 |
fn=gradio_interface,
|
| 103 |
inputs=gr.File(label="Upload PDF"),
|
| 104 |
outputs=gr.File(label="Download Extracted Excel"),
|
|
|
|
| 107 |
)
|
| 108 |
|
| 109 |
if __name__ == "__main__":
|
| 110 |
+
iface.launch()
|