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.0.tar.gz
(3.0 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.0.tar.gz.
File metadata
- Download URL: phinity-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
488d659cb5d1ef55f859fbe36b97612f669e46a303eeeb9ca9301f46d6aa3dc1
|
|
| MD5 |
788780b7d524163c1444d393581ebb7c
|
|
| BLAKE2b-256 |
5e2d907e683acc6a5797120460441dca8ac58006f630155bd793196fcc8a6132
|
File details
Details for the file phinity-0.1.0-py3-none-any.whl.
File metadata
- Download URL: phinity-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 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 |
483c358336de19187b6295b7fcedc2a4afd136e14f73a84a56ebb3352bf37df5
|
|
| MD5 |
fd05acece2c15c819e169b1b98548fe6
|
|
| BLAKE2b-256 |
6c0099378cbc877b8b2633ad0c011d4b24dfee3e4cadaa2a7356087758e3cea0
|