#nlp #llm #ai #mistral #llama #helper #text-generation

kalosm-sample

A common interface for token sampling and helpers for structered llm sampling

5 unstable releases

0.3.2 Aug 14, 2024
0.3.0 Aug 13, 2024
0.2.1 Feb 28, 2024
0.2.0 Feb 18, 2024
0.1.0 Dec 16, 2023

#450 in Machine learning

Download history 24/week @ 2024-07-29 23/week @ 2024-08-05 322/week @ 2024-08-12 53/week @ 2024-08-19 75/week @ 2024-08-26 32/week @ 2024-09-02 31/week @ 2024-09-09 237/week @ 2024-09-16 198/week @ 2024-09-23 122/week @ 2024-09-30 65/week @ 2024-10-07 119/week @ 2024-10-14 57/week @ 2024-10-21 81/week @ 2024-10-28 61/week @ 2024-11-04 48/week @ 2024-11-11

261 downloads per month
Used in 12 crates (5 directly)

MIT/Apache

165KB
4.5K SLoC

kalosm-sample

This is a sampling library for Kalosm.

It handles choosing a token from a probability distribution. Samplers can be used to constrain the generation of text for example you can use a sampler to prevent the model from generating the same word twice in a row. Or you could only allow the model to generate a list of single digit numbers.

Dependencies

~1.5–2.5MB
~37K SLoC