KarthickAdopleAI commited on
Commit
661fbe3
·
verified ·
1 Parent(s): 93952b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -61,7 +61,7 @@ def download_report():
61
  with open(report_file_path,"w") as file:
62
  file.write(message)
63
 
64
- return message,report_file_path
65
 
66
  def bot(history):
67
  bot_message = sales_agent._call({})
@@ -133,11 +133,8 @@ with gr.Blocks(theme="Taithrah/Minimal") as demo:
133
  gen_report_view = gr.Textbox(label="Generated Report",container=False)
134
  with gr.Row():
135
  gen_report_btn = gr.Button("Generate Report")
136
- report_down_btn = [gr.File(label="Output File",
137
- file_count="single",
138
- file_types=["", ".", ".csv",".xls",".xlsx",".txt"])]
139
 
140
- # report_down_btn = gr.DownloadButton(label="Download Report",value=f"{os.getcwd()}/report.txt")
141
  with gr.Column(scale=0.50):
142
  with gr.Row():
143
  summary_view = gr.Textbox(label="Summary",container=False)
@@ -160,7 +157,7 @@ with gr.Blocks(theme="Taithrah/Minimal") as demo:
160
  bot, chatbot, chatbot
161
  )
162
  msg.submit(stages,[],show_stages)
163
- gen_report_btn.click(download_report,[],[gen_report_view,report_down_btn],queue=False)
164
  summary_btn.click(generate_convo_summary,[],summary_view)
165
  sentiment_btn.click(sentiment_analysis,[],sentiment_view)
166
  emotion_btn.click(emotion_analysis,[],emotion_view)
 
61
  with open(report_file_path,"w") as file:
62
  file.write(message)
63
 
64
+ return message
65
 
66
  def bot(history):
67
  bot_message = sales_agent._call({})
 
133
  gen_report_view = gr.Textbox(label="Generated Report",container=False)
134
  with gr.Row():
135
  gen_report_btn = gr.Button("Generate Report")
 
 
 
136
 
137
+ report_down_btn = gr.DownloadButton(label="Download Report",value=f"{os.getcwd()}/report.txt")
138
  with gr.Column(scale=0.50):
139
  with gr.Row():
140
  summary_view = gr.Textbox(label="Summary",container=False)
 
157
  bot, chatbot, chatbot
158
  )
159
  msg.submit(stages,[],show_stages)
160
+ gen_report_btn.click(download_report,[],gen_report_view,queue=False)
161
  summary_btn.click(generate_convo_summary,[],summary_view)
162
  sentiment_btn.click(sentiment_analysis,[],sentiment_view)
163
  emotion_btn.click(emotion_analysis,[],emotion_view)