Garvitj commited on
Commit
51b2032
·
verified ·
1 Parent(s): 18a9a60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -242,7 +242,7 @@ def analyze_data(user_input):
242
  prompt = f"Analyze this data: {user_input}"
243
  return client.text_generation(prompt, max_new_tokens=200).strip()
244
 
245
- def sql_chatbot(user_input, db_user=None, db_pass=None, db_host="localhost", db_name=None, num_rows=10):
246
  task = classify_task(user_input)
247
 
248
  if "generate_sql" in task:
@@ -266,10 +266,6 @@ iface = gr.Interface(
266
  fn=sql_chatbot,
267
  inputs=[
268
  gr.Textbox(label="User Input"),
269
- gr.Textbox(label="MySQL Username", interactive=True),
270
- gr.Textbox(label="MySQL Password", interactive=True, type="password"),
271
- gr.Textbox(label="MySQL Host", interactive=True, value="localhost"),
272
- gr.Textbox(label="Database Name", interactive=True),
273
  gr.Number(label="Number of Rows", interactive=True, value=10, precision=0)
274
  ],
275
  outputs=[gr.Textbox(label="Response"), gr.File(label="File Output")]
 
242
  prompt = f"Analyze this data: {user_input}"
243
  return client.text_generation(prompt, max_new_tokens=200).strip()
244
 
245
+ def sql_chatbot(user_input, num_rows=10):
246
  task = classify_task(user_input)
247
 
248
  if "generate_sql" in task:
 
266
  fn=sql_chatbot,
267
  inputs=[
268
  gr.Textbox(label="User Input"),
 
 
 
 
269
  gr.Number(label="Number of Rows", interactive=True, value=10, precision=0)
270
  ],
271
  outputs=[gr.Textbox(label="Response"), gr.File(label="File Output")]