-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2eec202
commit bfa652b
Showing
17 changed files
with
113 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include agent/templates/*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
from agent.types import Step | ||
|
||
from agent.templates import load_step | ||
|
||
|
||
def pmpt_sys_init( | ||
lang: str | ||
) -> str: | ||
return f""" | ||
You are an Machine learning engineer, and you are currently working on | ||
an ML project using {lang} as the primary language. | ||
You are asked to generate a script and the script file name based on the user requirements. | ||
You are asked to generate a code script and the corresponding file name based on the user requirements. | ||
The output format should be: | ||
File Name: {{file name}} | ||
Code: {{code}} | ||
""" | ||
|
||
|
||
def hint_step( | ||
step: Step | ||
) -> str: | ||
return f""" | ||
You are currently working on step {step} of the project. | ||
An ML project in our workflow contains multiple steps, and each step is a task that you need to complete. | ||
Now, you are currently on step {step.step}:{step.name} | ||
This step is about {step.description} | ||
""" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(hint_step(load_step("data_collection.yml"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 0 | ||
name: "Data Collection" | ||
description: "Data collection in machine learning involves gathering, storing, and preparing high-quality, relevant data from various sources to train and evaluate machine learning models." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 1 | ||
name: "Data Engineering" | ||
description: "Data engineering focuses on the practical application of data collection and involves processing, cleansing, and verifying the integrity of data used for analysis. This step ensures that the dataset is ready for training by handling missing data, encoding categorical features, normalizing numerical data, and partitioning datasets into training, validation, and test sets." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 5 | ||
name: "Model Deployment" | ||
description: "Model deployment is the final step in the machine learning workflow where the trained model is deployed into a production environment. This can be a web server, a cloud-based application, or embedded systems, allowing the model to make predictions on new data. This step also includes monitoring the model's performance over time and updating it if necessary to maintain its effectiveness." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 4 | ||
name: "Model Evaluation" | ||
description: "After training, the model is evaluated to assess its performance. This typically includes using metrics such as accuracy, precision, recall, and F1-score for classification models, or mean squared error and R² for regression models. Evaluation helps in determining how well the model is likely to perform on unseen data." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 2 | ||
name: "Model Selection" | ||
description: "Model selection involves choosing the appropriate machine learning algorithms based on the problem type (e.g., regression, classification, clustering) and the nature of the data. This step may include comparing different models, tuning hyperparameters, and using techniques like cross-validation to ascertain the best model for the specific dataset and task." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
step: 3 | ||
name: "Model Training" | ||
description: "Model training is the process where the selected machine learning model is trained on the preprocessed data. This involves feeding the data into the model multiple times, adjusting model parameters (weights) to minimize a loss function, and using optimization techniques like gradient descent to find the best model parameters." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import yaml | ||
from pydantic import ValidationError | ||
|
||
from agent.types import Step | ||
|
||
|
||
def load_step(file_name: str) -> Step: | ||
""" | ||
Load a step from a .yaml file. | ||
:param file_name: the name of the configuration file. | ||
:return: | ||
""" | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
yml_path = os.path.join(dir_path, file_name) | ||
|
||
with open(yml_path, 'r') as file: | ||
data = yaml.safe_load(file) | ||
try: | ||
config = Step(**data) | ||
return config | ||
except ValidationError as e: | ||
print(f"Error in loading step file: {e}") | ||
raise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .project import ProjectState | ||
from .step import Step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class Step(BaseModel): | ||
step: int | ||
name: str | ||
description: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from .config import * | ||
from .system import * | ||
from .code import * | ||
from .chat import Chat |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters