OpenAI Model Trainer and Formatter
Project description
FineTuningDataCreator Package
Overview
The FineTuningDataCreator
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 fine_tuning_data_creator import FineTuningDataCreator
-
Create an instance of
FineTuningDataCreator
:data_creator = FineTuningDataCreator()
-
Set system content, training prompts, and generative responses as needed:
data_creator.agent_instructions("System instructions here") data_creator.training_prompt("User prompt here") gpt_response = openai_api_call("User prompt here") data_creator.generative_response(gpt_response)
-
Create the data set:
data_creator.create_data_set()
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-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3adb12a5b98ba1d8cea36c44d0713fcb3bac536372c6f0d3e8ce809942c4668f |
|
MD5 | 2f6b0c0e3feb09d08acf59a9be39b223 |
|
BLAKE2b-256 | f823d0121137534d4884b5b4a974d4885b53ef4228a2620607b187285a4ef35a |