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.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49f5c6b25ae17aad44779e1d44985b479a5863e9822c4477bfd48d5c794e3cb9 |
|
MD5 | bd0016388d21dbfe6cfb92b247ad82c3 |
|
BLAKE2b-256 | aa5ee8a6fc466878ba632ad87d700bb48cec2c0e5f560e206dd86700336f8d78 |