Skip to main content

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

pip install codara-model-trainer

Usage

  1. Create the data set with agent instructions, training prompts, and generative responses as needed:
    from codara_model_trainer import create_data_set
    
    gpt_response = openai_api_call("User prompt here")
    create_data_set("System instructions here", "User prompt here", gpt_response, "optional-filepath/filename.jsonl")
    

The data will be saved in the model-training/fine-tune-data-set.jsonl file if the filepath isn't set.

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"
    }
  ]
}

Metadata

Release files for codara-model-trainer 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codara-model-trainer 2.0.0
File Size Uploaded
codara-model-trainer-2.0.0.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codara-model-trainer 2.0.0
File Interpreter ABI Platform
codara_model_trainer-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / codara-model-trainer-2.0.0.tar.gz

Download URL codara-model-trainer-2.0.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4fb466f5ad0885438933c900941b5e9dd8ca68a5cbe9d23f3c7c7179dc22d106
BLAKE2b-256 checksum
How to use checksums
5f97e1edffb5d36746a3b9c114d4714bf8187b87280364b48d696cbf2c0db90d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / codara_model_trainer-2.0.0-py3-none-any.whl

Download URL codara_model_trainer-2.0.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83877bed0cccc6f1031d872ff71f813f04e43a15c07c8da4970519628cdc4683
BLAKE2b-256 checksum
How to use checksums
eec35665642aac12ae2a885a4086ead4a113889414cb236007f377416866fd08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page