LLM plugin for interpolating between embeddings
Project description
llm-interpolate
LLM plugin for interpolating between embeddings
Installation
Install this plugin in the same environment as LLM.
llm install llm-interpolate
Usage
The plugin adds a new command, llm interpolate
. This command takes the name of an
embedding collection
and two ids from that collection that will act as start and end points.
First, populate a collection. In this case we are embedding a song library using the CLAP model.
llm embed-multi -m clap songs --files mysongs "*.wav"
Now we can interpolate between those song embeddings with five intermediate points:
llm interpolate songs "MyRapSong.wav" "MyContrySong.wav" -n 5
You can use the -d
option to use a different embeddings database.
What this will do is try and find points in the embedding space in-between the given points.
The output should look something like this (truncated):
[
"MyRapSong.wav",
"HipHopMeetsCountry.wav",
"SmoothCountryRap.wav",
"CountryVibes.wav",
"MyCountrySong.wav"
]
This output can then be used to build a cohesive playlist using only a starting and ending song.
llm interpolate songs "MyRapSong.wav" "MyContrySong.wav" -n 5 | jq .[] > playlist.m3u
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-interpolate
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
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
Built Distribution
File details
Details for the file llm_interpolate-0.1.tar.gz
.
File metadata
- Download URL: llm_interpolate-0.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66afa94cb47ed8a802aa69a80e9bb856feeccd51a71eeeff0b6b4d90252fb591 |
|
MD5 | 8d0ab930c4538c90e9374e2f0e842ddb |
|
BLAKE2b-256 | d1247bab499ad0566871c7a6ca2ba857a95a3dbd8572de2071846a8699a6fc29 |
File details
Details for the file llm_interpolate-0.1-py3-none-any.whl
.
File metadata
- Download URL: llm_interpolate-0.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 660927154908fec5d1505c963bb68738184022c5e31254e59b2d3f71bc1bca95 |
|
MD5 | 2314679557f338dc69ebd7306f51dd4a |
|
BLAKE2b-256 | 748c0af55208e2c51625482a9b8c8af012a991c089112ddfd8251a2a725697b1 |