codys12 commited on
Commit
ad15c08
·
verified ·
1 Parent(s): e570bda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -339,7 +339,13 @@ def process_file(uploaded_file):
339
  Takes the uploaded file, processes it, and returns the CSV as a file-like object
340
  """
341
  processed_csv_io = process_woocommerce_data_in_memory(uploaded_file)
342
- return processed_csv_io
 
 
 
 
 
 
343
 
344
  interface = gr.Interface(
345
  fn=process_file,
 
339
  Takes the uploaded file, processes it, and returns the CSV as a file-like object
340
  """
341
  processed_csv_io = process_woocommerce_data_in_memory(uploaded_file)
342
+
343
+ # Create a temporary file to save the CSV data
344
+ with tempfile.NamedTemporaryFile(delete=False, suffix='.csv') as temp_file:
345
+ temp_file.write(processed_csv_io.getvalue())
346
+ temp_path = temp_file.name
347
+
348
+ return temp_path
349
 
350
  interface = gr.Interface(
351
  fn=process_file,