Skip to main content

Microlib for sampling from an LLM

Project description

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

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

llm_sampler-0.4.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

llm_sampler-0.4.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

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