Spaces:
Sleeping
Sleeping
Commit
·
be9fa47
1
Parent(s):
ea0ef5f
updated the smolagents
Browse files- Oracle/DataSmolAgent.py +6 -9
Oracle/DataSmolAgent.py
CHANGED
@@ -5,8 +5,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
5 |
|
6 |
@tool
|
7 |
def clean_data(df: pd.DataFrame) -> pd.DataFrame:
|
8 |
-
"""
|
9 |
-
Clean the DataFrame by stripping whitespace from column names and dropping rows that are completely empty.
|
10 |
|
11 |
Args:
|
12 |
df (pd.DataFrame): The input DataFrame containing the raw data.
|
@@ -20,12 +19,11 @@ def clean_data(df: pd.DataFrame) -> pd.DataFrame:
|
|
20 |
|
21 |
@tool
|
22 |
def extract_features(df: pd.DataFrame) -> pd.DataFrame:
|
23 |
-
"""
|
24 |
-
|
25 |
-
|
26 |
Args:
|
27 |
df (pd.DataFrame): The input DataFrame containing the raw data.
|
28 |
-
|
29 |
Returns:
|
30 |
pd.DataFrame: The DataFrame updated with new dynamically engineered features.
|
31 |
"""
|
@@ -61,12 +59,11 @@ def extract_features(df: pd.DataFrame) -> pd.DataFrame:
|
|
61 |
|
62 |
@tool
|
63 |
def save_to_csv(df: pd.DataFrame, filename: str = "output.csv") -> str:
|
64 |
-
"""
|
65 |
-
Save the DataFrame to a CSV file.
|
66 |
|
67 |
Args:
|
68 |
df (pd.DataFrame): The DataFrame to save.
|
69 |
-
filename (str): The name of the output CSV file.
|
70 |
|
71 |
Returns:
|
72 |
str: The file path of the saved CSV.
|
|
|
5 |
|
6 |
@tool
|
7 |
def clean_data(df: pd.DataFrame) -> pd.DataFrame:
|
8 |
+
"""Clean the DataFrame by stripping whitespace from column names and dropping rows that are completely empty.
|
|
|
9 |
|
10 |
Args:
|
11 |
df (pd.DataFrame): The input DataFrame containing the raw data.
|
|
|
19 |
|
20 |
@tool
|
21 |
def extract_features(df: pd.DataFrame) -> pd.DataFrame:
|
22 |
+
"""Dynamically extract features from the DataFrame.
|
23 |
+
|
|
|
24 |
Args:
|
25 |
df (pd.DataFrame): The input DataFrame containing the raw data.
|
26 |
+
|
27 |
Returns:
|
28 |
pd.DataFrame: The DataFrame updated with new dynamically engineered features.
|
29 |
"""
|
|
|
59 |
|
60 |
@tool
|
61 |
def save_to_csv(df: pd.DataFrame, filename: str = "output.csv") -> str:
|
62 |
+
"""Save the DataFrame to a CSV file.
|
|
|
63 |
|
64 |
Args:
|
65 |
df (pd.DataFrame): The DataFrame to save.
|
66 |
+
filename (str): The name of the output CSV file (default "output.csv").
|
67 |
|
68 |
Returns:
|
69 |
str: The file path of the saved CSV.
|