Tools for working with Ollama
Project description
Matt's Ollama Tools
I needed some simple tools to make it easier to work with integrating Ollama with the real world. This is a collection of those tools.
Chunker
Sometimes you need to take a bunch of text in and then spit it out in an array of chunks. This will take in a long text and then split it into chunks of up to a defined number of words. It won't ever get sentence fragments. It will overlap each chunk by one sentence. If you have a text with a bunch of poorly written run-on sentences, this might not work.
Usage
from mattsollamatools import chunker
textchunks = chunker(text, max_words_per_chunk=110)
If you don't include max_words_per_chunk, it will default to 100.
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
Close
Hashes for mattsollamatools-0.0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7b3daacd33ae5d7c841c7c1174d98c7b795be500dada5058bd81b63fa6457f |
|
MD5 | f789af2cbe6bd49e428b16ee839601c9 |
|
BLAKE2b-256 | 354da4e96b92dc9570ce04cfd5e36c026dd8a407205e316b7eff73ac07fb5e4d |