Skip to main content

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, language='spanish')

If you don't include max_words_per_chunk, it will default to 100. If you don't include language, it will default to 'english'.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mattsollamatools-0.0.25.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mattsollamatools-0.0.25-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file mattsollamatools-0.0.25.tar.gz.

File metadata

  • Download URL: mattsollamatools-0.0.25.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for mattsollamatools-0.0.25.tar.gz
Algorithm Hash digest
SHA256 9b46af73c52eb3d1656c651423ebd11da5aadce148f2931b882edb6c0031f774
MD5 6179a66e4dec5bd3be41a34c9b6ce9b5
BLAKE2b-256 8ddf483b56638c619b140e00102ee794869ebf858405fc46062de06c99e01e10

See more details on using hashes here.

File details

Details for the file mattsollamatools-0.0.25-py3-none-any.whl.

File metadata

File hashes

Hashes for mattsollamatools-0.0.25-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d32eb65217006faff58591b4187c086047f3ade998b0539d0b6807b7b13533
MD5 532fdee528d14fca7d64ce0d773d2878
BLAKE2b-256 2ba736590304bee11ef4fa64f2c36b49f857a633751fe7622e0af8dfa1aa0ce8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page