Update app.py
Browse files
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,
|
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")]
|