rameshmoorthy commited on
Commit
a39c7da
1 Parent(s): 438413d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import pandas as pd
3
  from functions import process_file_bm25 , process_file_bert , generate_plot , generate
4
-
5
  #------------------------------------------------------
6
 
7
  # Create the state object
@@ -55,7 +55,9 @@ with gr.Blocks() as bm25:
55
  return None,doc # Return immediately with the error message
56
 
57
  doc = 'File uploaded! Press Cluster button'
58
- return df,doc # Return the success message
 
 
59
 
60
 
61
  def download_df():
 
1
  import gradio as gr
2
  import pandas as pd
3
  from functions import process_file_bm25 , process_file_bert , generate_plot , generate
4
+ from tempfile import NamedTemporaryFile
5
  #------------------------------------------------------
6
 
7
  # Create the state object
 
55
  return None,doc # Return immediately with the error message
56
 
57
  doc = 'File uploaded! Press Cluster button'
58
+ temp_file = NamedTemporaryFile(delete=False, suffix=".xlsx")
59
+ df.to_excel(temp_file.name, index=False)
60
+ return temp_file.name,doc # Return the success message
61
 
62
 
63
  def download_df():