Skip to main content

LLM Sampler

Install with:

pip install llm_sampler

Downloads PyPi version PyPI license

Read the Docs Badge

llm_sampler allows you to sample from any LLM by given logits.

It is a collection of various sampling techniques found online.

For now, the methods are:

  1. sample_huggingface - the one used in transformers
  2. sample_gpt_fast - the one used in gpt-fast

It also allows you get probability scores for sequences given by the user.

For example, if you supply the input: Input: The sentiment of the sentence 'I loved it' is

  • Option 0: positive
  • Option 1: negative
  • Option 2: unknown

This lib will help you create_batch_with_continuations

Release files for llm-sampler 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-sampler 0.4.0
File Size Uploaded
llm_sampler-0.4.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-sampler 0.4.0
File Interpreter ABI Platform
llm_sampler-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / llm_sampler-0.4.0.tar.gz

Download URL llm_sampler-0.4.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dd3f789aa36b329e2bf9a52e77198dbd011f7628b8136e1362779a4ff1283931
BLAKE2b-256 checksum
How to use checksums
623f45c5c2b5d7241dd5f84bf27dc2351bc6c05eee40f0ed87c1faafe531a64d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / llm_sampler-0.4.0-py3-none-any.whl

Download URL llm_sampler-0.4.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b99d780695cfc1a58c807d3fc07d2f11726697ba06c25a8008d3972fc6c0342
BLAKE2b-256 checksum
How to use checksums
efc961ebef8a144e38007e22c0c286983a90c2dab0953df184f9e6f85d0220ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page