Skip to main content

Steerable data generation system for model training

Project description

⬜️ Open Datagen ⬜️

Open Datagen, a steerable data generation system for ML models training.

Features

  • Generate data in the format you want
  • Create custom templates with Pydantic models
  • Use predefined templates

Installation

pip install --upgrade opendatagen

Setting up the OpenAI API key

export OPENAI_API_KEY='your_openai_api_key'

Usage

Example: If you want to train a small model to write great python code

from opendatagen.data_generator import DataGenerator
from opendatagen.model import OpenAIModel, ModelName
from opendatagen.template import Template

variation_model = OpenAIModel(model_name=ModelName.GPT_35_TURBO_CHAT)
completion_model = OpenAIModel(model_name=ModelName.GPT_35_TURBO_INSTRUCT)

generator = DataGenerator(variation_model, completion_model)

# Create the custom template using the Pydantic models
user_template = Template(
    description="Custom template for Python exercises",
    prompt="Pthon exercice statement: {python_exercice_statement}",
    completion="Answer:\n{python_code}",
    prompt_variation_number=1,
    prompt_variables={
        "python_exercice_statement": Variable(
            name="Python exercice statement",
            temperature=1,
            max_tokens=64,
            generation_number=10
        )
    },
    completion_variables={
        "python_code": Variable(
            name="Python code",
            temperature=0,
            max_tokens=256,
            generation_number=1
        )
    }
)

data = generator.generate_data(template=user_template, 
                        output_path="output.csv")

print(data)

This code will generate a dataset of 5 medium-level Python exercises/answers formatted as you asked for.

Predefined Templates:

from opendatagen.data_generator import DataGenerator
from opendatagen.model import OpenAIModel, ModelName
from opendatagen.template import TemplateManager, TemplateName

generator = DataGenerator(variation_model, completion_model)

manager = TemplateManager()
template = manager.get_template(TemplateName.PRODUCT_REVIEW)

data = generator.generate_data(template=template, output_path="output.csv")

print(data)

You can find the templates in the template.json file.

Roadmap

  • Enhance completion quality with sources like Internet, local files, and vector databases
  • Augment and replicate sourced data
  • Ensure data anonymity & open-source model support
  • Future releases to support multimodal data

Note

Please note that opendatagen is initially powered by OpenAI's models. Be aware of potential biases and use the start_with and note field to guide outputs.

Acknowledgements

We would like to express our gratitude to the following open source projects and individuals that have inspired and helped us:

Connect

Reach us on Twitter: @thoddnn.

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

opendatagen-0.0.6.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendatagen-0.0.6-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file opendatagen-0.0.6.tar.gz.

File metadata

  • Download URL: opendatagen-0.0.6.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for opendatagen-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f8a0c153bd06d27307edbdb483a62ea4bcee9a81e34000ba6b1c6cb878edc694
MD5 cd7a8e3eef1e1391463b520a84821f18
BLAKE2b-256 153d1dacd7e559089f292145f23255155a560b00360e29d81547286afd679b10

See more details on using hashes here.

File details

Details for the file opendatagen-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: opendatagen-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for opendatagen-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b95b3a6d8b06e996915ba0c63639cf141f12ad8418c0b73dd597c04562797111
MD5 6782a6fd6d8d0509419d8e54e3269a2b
BLAKE2b-256 c6c9bf60192abb7bbb3d351555194a289458acca29ed7370c616976b3fcf7411

See more details on using hashes here.

Supported by

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