You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gptrim

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gptrim

Reduce the size of GPT inputs by 40-60% without losing most of the information.

0.1.6
pipPyPI
Maintainers
1

gptrim

gptrim is a Python library designed to help you trim text inputs, making it easier to fit more content within GPT’s context window. By tokenizing, stemming, and removing spaces, this library prepares your text inputs for efficient processing with GPT models.

Installation

.. code:: commandline

pip install gptrim

Usage

.. code:: python

from gptrim import trim

text = "This is an example sentence to demonstrate gptrim usage." trimmed_text = trim(text) print(trimmed_text)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts