Skip to main content

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

  1. Import the package:

    from fine_tuning_data_creator import FineTuningDataCreator
    
  2. Create an instance of FineTuningDataCreator:

    data_creator = FineTuningDataCreator()
    
  3. 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)
    
  4. 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

codara-model-trainer-0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

codara_model_trainer-0.1-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page