pavanmutha commited on
Commit
6c9a61f
·
verified ·
1 Parent(s): 995c9b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -194,12 +194,12 @@ def analyze_data(csv_file, additional_notes=""):
194
  raw_output = agent.run("""
195
  You are a data analysis agent. Output in JSON only. Follow these instructions EXACTLY without any deviation:
196
  1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
197
- 2. Analyze the data structure and generate up to 3 visualizations and 3 insights.
198
  3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
199
  4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
200
  5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
201
  6. Run only 5 steps and return output in less than a minute.
202
- 7. DO NOT include any natural language (e.g., "Thoughts:", "Code:", explanations).
203
  8. ONLY output a single, valid JSON block. No markdown or extra text.
204
  9. Output ONLY the following JSON code block format, exactly:
205
  {
@@ -592,7 +592,7 @@ with gr.Blocks() as demo:
592
  with gr.Column():
593
  insights_output = gr.HTML(label="Insights from SmolAgent")
594
  visual_output = gr.Gallery(label="Visualizations (Auto-generated by Agent)", columns=2)
595
- agent_btn = gr.Button("Run AI Agent (5 Insights + 5 Visualizations)")
596
 
597
  with gr.Row():
598
  train_btn = gr.Button("Train Model with Optuna + WandB")
 
194
  raw_output = agent.run("""
195
  You are a data analysis agent. Output in JSON only. Follow these instructions EXACTLY without any deviation:
196
  1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
197
+ 2. Analyze the data and generate up to 3 visualizations and 3 insights.
198
  3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
199
  4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
200
  5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
201
  6. Run only 5 steps and return output in less than a minute.
202
+ 7. ONLY include natural language as observation value or insight value.
203
  8. ONLY output a single, valid JSON block. No markdown or extra text.
204
  9. Output ONLY the following JSON code block format, exactly:
205
  {
 
592
  with gr.Column():
593
  insights_output = gr.HTML(label="Insights from SmolAgent")
594
  visual_output = gr.Gallery(label="Visualizations (Auto-generated by Agent)", columns=2)
595
+ agent_btn = gr.Button("Run AI Agent (3 Insights + 3 Visualizations)")
596
 
597
  with gr.Row():
598
  train_btn = gr.Button("Train Model with Optuna + WandB")