NCTCMumbai commited on
Commit
a3d9931
·
verified ·
1 Parent(s): b36583c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -44,7 +44,7 @@ def variable_table(df):
44
  categorical_vars.append(col)
45
  print('categorical')
46
  print(categorical_vars,numerical_vars,text_vars)
47
- gr.Info(f"Column Analysis completed. {len(categorical_vars)} categorical variables , {len(numerical_vars)} numerical variables , {len(text_vars)} found!")
48
  # Build HTML table with styles
49
  table_style = 'border: 1px solid #ddd; border-collapse: collapse; text-align: left; font-size: 14px;'
50
  header_style = 'background-color: #f2f2f2; padding: 5px 10px;'
@@ -187,6 +187,7 @@ def generate_report(file, type):
187
 
188
  def query_chat(query):
189
  df=df1.value
 
190
  return df.sketch.ask(query)
191
 
192
  def handle_click(file, sheet_name):
@@ -243,9 +244,10 @@ with gr.Blocks() as cluster:
243
  info="Natural language query",
244
  lines=1,
245
  value="What is maximum value of first column")
246
- outlabel=gr.HighlightedText(label='Query Result ')
 
247
  query_btn=gr.Button(value='Submit Query')
248
- query_btn.click(query_chat,inputs=query,outputs=outlabel)
249
 
250
 
251
 
 
44
  categorical_vars.append(col)
45
  print('categorical')
46
  print(categorical_vars,numerical_vars,text_vars)
47
+ gr.Info(f"Column Analysis completed. {len(categorical_vars)} categorical variables , {len(numerical_vars)} numerical variables , {len(text_vars)} Text variables found!")
48
  # Build HTML table with styles
49
  table_style = 'border: 1px solid #ddd; border-collapse: collapse; text-align: left; font-size: 14px;'
50
  header_style = 'background-color: #f2f2f2; padding: 5px 10px;'
 
187
 
188
  def query_chat(query):
189
  df=df1.value
190
+ print(df.sketch.ask(query))
191
  return df.sketch.ask(query)
192
 
193
  def handle_click(file, sheet_name):
 
244
  info="Natural language query",
245
  lines=1,
246
  value="What is maximum value of first column")
247
+ #outlabel=gr.HighlightedText(label='Query Result ')
248
+ outbox=gr.Textbox(label='Query Result')
249
  query_btn=gr.Button(value='Submit Query')
250
+ query_btn.click(query_chat,inputs=query,outputs=outbox)
251
 
252
 
253