semvec/pypi-packages huggingface dataset:
culturgen 0.1.2
Know Your Meme scraper, a rewrite of memedict.
License: MIT

# culturgen

`culturgen` is a Know Your Meme scraper.

It's originally based on an older scraper package called
`memedict` ([GitHub](https://github.com/Kraymer/memedict), [PyPI](https://pypi.org/project/memedict/)).

## Install

```sh
pip install culturgen
```

## Usage

Use `search()` to get a quick meme definition based on keywords:

```pycon
>>> import culturgen
>>> culturgen.search('all your base')
All Your Base Are Belong To Us. "All Your Base Are Belong to Us" is a popular
engrish catchphrase that grew popular across the internet as early as in 1998.
An awkward translation of "all of your bases are now under our control", the
quote originally appeared in the opening dialogue of Zero Wing, a 16-bit
shoot'em up game released in 1989. Marked by poor grammar, the "All Your Base"
phrase and the dialogue scene went viral on popular discussion forums in 2000,
spawning thousands of image macros and flash animations featuring the slogan
both on the web and in real life.
```

## Changelog

### 0.1.2

* Fixed incorrect return value format of `search_meme()` URL field

### 0.1.1

* Made similarity threshold check case-insensitive

### 0.1.0

* Updated to fix apparent changes from KYM that broke the old library
* Modernized package metadata
* Made a few miscellaneous tweaks
distil-whisper-fastrtc 0.1.0.post1
Distil-Whisper wrapper for FastRTC speech-to-text
License: MIT
Requires Python: >=3.8

# Distil-Whisper for FastRTC

A PyPI package that wraps Hugging Face's Distil-Whisper model for speech-to-text (STT) transcription, compatible with the FastRTC STTModel protocol.

## Installation

```bash
pip install distil-whisper-fastrtc
```

For audio file loading capabilities, install with the audio extras:

```bash
pip install distil-whisper-fastrtc[audio]
```

For development:

```bash
pip install distil-whisper-fastrtc[dev]
```

## Usage

### Basic Usage

```python
from distil_whisper_fastrtc import get_stt_model
import numpy as np

# Create the model (downloads from HF if not cached)
model = get_stt_model()

# Example: Create a sample audio array (actual audio would come from a file or mic)
sample_rate = 16000
audio_data = np.zeros(16000, dtype=np.float32)  # 1 second of silence

# Transcribe
text = model.stt((sample_rate, audio_data))
print(f"Transcription: {text}")
```

### Loading Audio Files

If you've installed with the audio extras:

```python
from distil_whisper_fastrtc import get_stt_model, load_audio

# Load model
model = get_stt_model()

# Load audio file (automatically resamples to 16kHz)
audio = load_audio("path/to/audio.wav")

# Transcribe
text = model.stt(audio)
print(f"Transcription: {text}")
```

### Using with FastRTC

```python
from distil_whisper_fastrtc import get_stt_model

# Create the model
whisper_model = get_stt_model()

# Use within FastRTC applications
# (Follow FastRTC documentation for integration details)
```

## Available Models

You can choose from different model sizes:

- `distil-whisper/distil-small.en` (default, English only, fastest)
- `distil-whisper/distil-medium.en` (English only, better quality)
- `distil-whisper/distil-large-v2` (English highest quality)
- `distil-whisper/distil-large-v3` (Latest version, best quality)

Example:
```python
from distil_whisper_fastrtc import get_stt_model

# Choose a larger model
model = get_stt_model("distil-whisper/distil-large-v2")
```

## Advanced Configuration

You can configure the model with various parameters:

```python
from distil_whisper_fastrtc import DistilWhisperSTT

# Configure with specific device and precision
model = DistilWhisperSTT(
    model="distil-whisper/distil-medium.en",
    device="cuda",  # Use GPU if available
    dtype="float16"  # Use half precision for faster inference
)
```

## Requirements

- Python 3.8+
- PyTorch 1.10+
- transformers 4.30+
- numpy 1.20+
- accelerate 0.20+ (for faster inference)
- librosa 0.9+ (optional, for audio file loading)

## Development

Clone the repository and install in development mode:

```bash
git clone https://github.com/yourusername/distil-whisper-fastrtc.git
cd distil-whisper-fastrtc
pip install -e ".[dev,audio]"
```

Run tests:

```bash
pytest tests/
```

## License

MIT