A framework for fine-tuning language models with preference data
Project description
Phinity
A self-improvement SDK for language models.
Installation
pip install -e .
Usage
from phinity import LLMGenerator
from phinity.utils.config import Config
# Setup OpenAI
Config.setup_openai() # Or provide key: Config.setup_openai("your-api-key")
# Create generator
generator = LLMGenerator()
# Generate pairs
instructions = ["Write a haiku about programming"]
pairs = generator.generate_pairs(instructions=instructions)
Now let's create and activate a virtual environment:
```bash:create_project.sh
# Create project structure
mkdir -p phinity/phinity/{core,generators,evaluators,utils}
mkdir -p phinity/examples
touch phinity/README.md
touch phinity/setup.py
touch phinity/requirements.txt
touch phinity/phinity/__init__.py
touch phinity/phinity/core/__init__.py
touch phinity/phinity/generators/__init__.py
touch phinity/phinity/evaluators/__init__.py
touch phinity/phinity/utils/__init__.py
touch phinity/.env.template
touch phinity/.gitignore
# Create and activate virtual environment
cd phinity
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
# Install package in development mode
pip install -e .
Now you should be able to:
- Create the virtual environment and install the package:
cd phinity
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
pip install -e .
- Copy the template and add your API key:
cp .env.template .env
# Edit .env and add your API key
- Run the test:
python examples/openai_test.py
Would you like me to make any adjustments to these files or add any additional setup steps?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phinity-0.1.2.tar.gz
(7.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phinity-0.1.2.tar.gz.
File metadata
- Download URL: phinity-0.1.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c22e9fc6dbc073754288eee236ca5ec800c56ae886a89adbce043d771211b89a
|
|
| MD5 |
6a8f1a91ad7c15f02b5862008380642b
|
|
| BLAKE2b-256 |
67269dbbf5ee1a2d5ddd9da559e92fea81a70f4c2f934295f4716230be72cbd1
|
File details
Details for the file phinity-0.1.2-py3-none-any.whl.
File metadata
- Download URL: phinity-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9bbde2c82c9c6dda6dce139e3822154a8b1cca1360899b5f22cdc12a9e30c6
|
|
| MD5 |
f86174658e4f03bc6672d3998919f72b
|
|
| BLAKE2b-256 |
d8c56703560b0ff019824a097f3332a0e02fcf9ca701c62abf989a72d4a745fb
|