DSatishchandra commited on
Commit
d71be9b
·
verified ·
1 Parent(s): 615fc49

Update BHEL.py

Browse files
Files changed (1) hide show
  1. BHEL.py +3 -3
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 = "/tmp/Extracted_PO_Data_Dynamic.xlsx"
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
- interface = gr.Interface(
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
- interface.launch()
 
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()