OpenAI Model Trainer and Formatter
Project description
codara-model-trainer
Overview
The codara-model-trainer
is a Python package designed to assist in creating datasets for fine-tuning machine learning
models, particularly language models. It simplifies the process of gathering and formatting training data in a JSON
Lines (JSONL) format.
Features
- Easy creation of training data sets in JSONL format.
- Methods to set system instructions, training prompts, and generative responses.
- Automatically handles file creation and appending data in the correct format.
Installation
No specific installation is required apart from having Python installed. The script uses standard Python libraries os
and json
.
Usage
-
Import the package:
from codara_model_trainer import FineTuningDataCreator
-
Create an instance of
FineTuningDataCreator
:data_creator = FineTuningDataCreator()
-
Create the data set with agent instructions, training prompts, and generative responses as needed:
gpt_response = openai_api_call("User prompt here") data_creator.create_data_set("System instructions here", "User prompt here", gpt_response)
The data will be saved in the model-training/fine-tune-data-set.jsonl
file.
Structure of Data
The data is structured in JSON Lines format, where each line is a valid JSON object. An example of the data structure:
{
"messages": [
{
"role": "system",
"content": "System instructions here"
},
{
"role": "user",
"content": "User prompt here"
},
{
"role": "assistant",
"content": "Model response here"
}
]
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for codara-model-trainer-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d97dd82de1d2efd4d435e7bc17fc495b8120926909ec1a1099dc6fe5c4ae65c |
|
MD5 | f35fa8d80924019414827e0ce7aca691 |
|
BLAKE2b-256 | 391cb3da1c6c8219f866554f9e843609385a3afa8c7aa41798db47d260817a19 |
Hashes for codara_model_trainer-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1499a04060abfa5366fc236bf24628d7d793eb778cf4a9f9bbd4f3607dde2a24 |
|
MD5 | 540006d03a8d3bcb1983171791de90d7 |
|
BLAKE2b-256 | 52457529441c23b4916d8495f8a9ecd06f03dd1e6f60ea8575e1037a3dd29aae |