Update app.py
Browse files
app.py
CHANGED
|
@@ -73,20 +73,25 @@ def run_agent(_):
|
|
| 73 |
- At least 3 visualizations showing important trends.
|
| 74 |
4. Derive at least 3 actionable real-world insights.
|
| 75 |
5. Save all visualizations to ./figures/ directory.
|
| 76 |
-
Return:
|
| 77 |
-
-
|
| 78 |
-
-
|
| 79 |
"""
|
| 80 |
|
| 81 |
-
result = agent.run(
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
-
|
| 84 |
-
insights =
|
|
|
|
| 85 |
|
| 86 |
return insights, image_paths
|
| 87 |
|
| 88 |
|
| 89 |
|
|
|
|
| 90 |
def train_model(_):
|
| 91 |
wandb.login(key=os.environ.get("WANDB_API_KEY"))
|
| 92 |
#wandb_run = wandb.init(project="huggingface-data-analysis", name="Optuna_Run", reinit=True)
|
|
|
|
| 73 |
- At least 3 visualizations showing important trends.
|
| 74 |
4. Derive at least 3 actionable real-world insights.
|
| 75 |
5. Save all visualizations to ./figures/ directory.
|
| 76 |
+
Return a dictionary with keys:
|
| 77 |
+
- 'insights': clean bullet-point insights.
|
| 78 |
+
- 'figures': list of file paths of generated visualizations.
|
| 79 |
"""
|
| 80 |
|
| 81 |
+
result = agent.run(
|
| 82 |
+
prompt,
|
| 83 |
+
additional_args={"source_file": temp_file.name}
|
| 84 |
+
)
|
| 85 |
|
| 86 |
+
# Now, result is expected to be a dictionary
|
| 87 |
+
insights = result.get("insights", "No insights generated.")
|
| 88 |
+
image_paths = result.get("figures", [])
|
| 89 |
|
| 90 |
return insights, image_paths
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
+
|
| 95 |
def train_model(_):
|
| 96 |
wandb.login(key=os.environ.get("WANDB_API_KEY"))
|
| 97 |
#wandb_run = wandb.init(project="huggingface-data-analysis", name="Optuna_Run", reinit=True)
|