Daksh Chaudhary
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -39,18 +39,7 @@ print("--- Hugging Face Space setup complete. Initializing Agent ---")
|
|
39 |
nl_sql_agent_instance = NLSQLAgent()
|
40 |
print("NLSQLAgent initialized.")
|
41 |
|
42 |
-
# --- Define Gradio Interface Functions ---
|
43 |
-
# async def query_agent_gradio(user_query: str) -> str:
|
44 |
-
# if not user_query.strip():
|
45 |
-
# return "Please enter a question to get started!"
|
46 |
-
|
47 |
-
# try:
|
48 |
-
# response = await nl_sql_agent_instance.process_query(user_query)
|
49 |
-
# return response
|
50 |
-
# except Exception as e:
|
51 |
-
# logging.error(f"Error processing query in Gradio app: {e}", exc_info=True)
|
52 |
-
# return f"An internal error occurred: {type(e).__name__}: {str(e)}. Please check the Space logs for more details."
|
53 |
-
|
54 |
def query_agent_gradio(user_query: str):
|
55 |
if not user_query.strip():
|
56 |
yield "Please enter a question to get started!"
|
@@ -116,7 +105,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
116 |
fn=query_agent_gradio,
|
117 |
inputs=user_query,
|
118 |
outputs=output_markdown,
|
119 |
-
show_progress="
|
120 |
)
|
121 |
|
122 |
clear_btn.add(components=[user_query, output_markdown])
|
|
|
39 |
nl_sql_agent_instance = NLSQLAgent()
|
40 |
print("NLSQLAgent initialized.")
|
41 |
|
42 |
+
# --- Define Gradio Interface Functions ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
def query_agent_gradio(user_query: str):
|
44 |
if not user_query.strip():
|
45 |
yield "Please enter a question to get started!"
|
|
|
105 |
fn=query_agent_gradio,
|
106 |
inputs=user_query,
|
107 |
outputs=output_markdown,
|
108 |
+
show_progress="minimal"
|
109 |
)
|
110 |
|
111 |
clear_btn.add(components=[user_query, output_markdown])
|