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.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39ad06aa1e087b2749d99cfd5f1175593456cfecf2deb77d171d6603755f131 |
|
MD5 | 2b43b78fff57dfd07adf8eb2087d40f1 |
|
BLAKE2b-256 | c23878db22399a9699ff770a5ded8f8a2940f2969e279b734807180cadf558c6 |