Metadata-Version: 2.4
Name: semantic-llm-short-ans-generator
Version: 0.1.1
Summary: Sample responses and log-probabilities from HuggingFace causal LMs
Author-email: Akshiya <raveendiran.21@cse.mrt.ac.lk>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0
Requires-Dist: transformers>=4.31
Requires-Dist: sentencepiece
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# LLM Sampler

A utility library for sampling responses and extracting log-probabilities from HuggingFace causal language models.

## Installation

```bash
pip install llm-sampler
```

## Features

- **Response Sampling**: Sample diverse responses from causal language models
- **Log-Probability Extraction**: Extract log-probabilities for generated tokens
- **HuggingFace Integration**: Works seamlessly with HuggingFace transformers
- **Batch Processing**: Efficient batch sampling and probability computation

## Usage

```python
from llm_sampler import LMSampler

sampler = LMSampler("gpt2")
responses, log_probs = sampler.sample(prompt, num_samples=5)
```

## Dependencies

- torch >= 2.0
- transformers >= 4.31
- sentencepiece

## License

See LICENSE file for details.
