Skip to main content

Steerable data generation system for LLM fine-tuning

Project description

⬜️ Open Datagen ⬜️

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

Features

  • Generate high-quality synthetic datasets using simple templates

  • Quality enhancement with RAG from Internet and local files

  • Data anonymization

  • Data evaluation & cleaning agent

  • (SOON) Open-source model support (+ local inference)

  • (SOON) Multimodality

Installation

pip install --upgrade opendatagen

Setting up the OpenAI API key (using openai>=1.2)

export OPENAI_API_KEY='your_openai_api_key'

Setting up the SERPLY API key for Google Search API (optional)

export SERPLY_API_KEY='your_serply_api_key'

Usage

Example: Generate a dataset of Python exercises using a template

from opendatagen.data_generator import DataGenerator
from opendatagen.model import LLM
from opendatagen.template import Template, Variable

# Create the custom template using the Pydantic models
user_template = Template(
    description="Custom template for Python exercises",
    prompt="Python 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=120,
            generation_number=10,
            model_name="gpt-3.5-turbo-1106"
        )
    },
    completion_variables={
        "python_code": Variable(
            name="Python code",
            temperature=0,
            max_tokens=256,
            generation_number=1,
            model_name="gpt-4"
        )
    }
)

#Or you can load your templates from a json file
#from opendatagen.template import TemplateManager
#user_template = TemplateManager("files/template.json")
#Note: you can find examples of json at https://github.com/thoddnn/open-datagen/blob/main/opendatagen/files/template.json

generator = DataGenerator(template=user_template)

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

print(data)

Once created, you can ask an AI Agent to evaluate and correct your dataset

from opendatagen.agent import DataAgent

agent = DataAgent()
    
agent.run()

Contribution

We welcome contributions to Open Datagen! Whether you're looking to fix bugs, add templates, new features, or improve documentation, your help is greatly appreciated.

Note

Please note that opendatagen is initially powered by OpenAI's models. Be aware of potential biases and use the 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.13.tar.gz (19.4 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.13-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opendatagen-0.0.13.tar.gz
  • Upload date:
  • Size: 19.4 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.13.tar.gz
Algorithm Hash digest
SHA256 ab139e7f9c02c0a69390606e35bab2ef084abad250259392bf508d9c5b109d0a
MD5 a089df0c84ec998ca18557fe40b0e581
BLAKE2b-256 46a392cee350dede8564161580565ef5c2af76da9ce4ecb310b91db93235fd85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendatagen-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 33.3 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7d5cdb29f168d75ec0f9f63c72816c95f86f58efaf7114c9a5b0740ebbe65ee3
MD5 81b8fd2684d76edd1c545275b94e05eb
BLAKE2b-256 32568141fed2dd9b474daedabb615f20600252f71a1b09cdd12ce43f3fac05a2

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