Commit ·
1e871c4
1
Parent(s): d272f1c
Add hf-jobs tag to README frontmatter
Browse filesStandardizing metadata tags across uv-scripts organization
for better discoverability of HF Jobs-compatible scripts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
123456789101120 unmodified lines3233343536373887 unmodified lines1261271281291301311324 unmodified lines13713813914014114214314414514614714814915015115215315421 unmodified lines17617717817918018118222 unmodified lines20520620720820921021121221321421520 unmodified lines236237238239240241242---viewer: falsetags: [uv-script, classification, vllm, structured-outputs, gpu-required]---# Dataset Classification ScriptGPU-accelerated text classification for Hugging Face datasets with guaranteed valid outputs through structured generation.## 🚀 Quick Start20 unmodified lines- **Guaranteed valid outputs** using structured generation with guided decoding- **Zero-shot classification** without training data required- **GPU-optimized** for maximum throughput and efficiency- **Default model**: HuggingFaceTB/SmolLM3-3B (fast 3B model with thinking capabilities)- **Robust text handling** with preprocessing and validation- **Automatic progress tracking** and detailed statistics- **Direct Hub integration** - read and write datasets seamlessly87 unmodified lines### Support Ticket Classification```bashuv run classify-dataset.py \--input-dataset user/support-tickets \--column content \--labels "bug,feature_request,question,other" \4 unmodified lines### News Categorization```bashuv run classify-dataset.py \--input-dataset ag_news \--column text \--labels "world,sports,business,tech" \--output-dataset user/ag-news-categorized \--model meta-llama/Llama-3.2-3B-Instruct```### Complex Classification with Reasoning```bashuv run classify-dataset.py \--input-dataset user/customer-feedback \--column text \--labels "very_positive,positive,neutral,negative,very_negative" \21 unmodified lines--shuffle# With reasoning for nuanced classificationuv run classify-dataset.py \--input-dataset librarian-bots/arxiv-metadata-snapshot \--column abstract \--labels "multimodal,agents,reasoning,safety,efficiency" \22 unmodified lines```### GPU Flavors- `t4-small`: Budget option for smaller models- `l4x1`: Good balance for 7B models- `a10g-small`: Fast inference for 3B models- `a10g-large`: More memory for larger models- `a100-large`: Maximum performance## 🔧 Advanced Usage20 unmodified lines### Using Different ModelsBy default, this script uses **HuggingFaceTB/SmolLM3-3B** - a fast, efficient 3B parameter model that's perfect for most classification tasks. You can easily use any other instruction-tuned model:```bash# Larger model for complex classification123456789101120 unmodified lines3233343536373887 unmodified lines1261271281291301311321331341351364 unmodified lines14114214314414514614714814915015115215315415515615715815916016116216316416521 unmodified lines18718818919019119219319419519622 unmodified lines21922022122222322422522622720 unmodified lines248249250251252253254255256257258259260---viewer: falsetags: [uv-script, classification, vllm, structured-outputs, gpu-required, hf-jobs]---# Dataset Classification ScriptGPU-accelerated text classification for Hugging Face datasets with guaranteed valid outputs through structured generation. Powered by SmolLM3-3B's advanced reasoning capabilities.## 🚀 Quick Start20 unmodified lines- **Guaranteed valid outputs** using structured generation with guided decoding- **Zero-shot classification** without training data required- **GPU-optimized** for maximum throughput and efficiency- **Default model**: [HuggingFaceTB/SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B) - a fast 3B model with native thinking capabilities (`<think>` tags)- **Robust text handling** with preprocessing and validation- **Automatic progress tracking** and detailed statistics- **Direct Hub integration** - read and write datasets seamlessly87 unmodified lines### Support Ticket Classification```bash# Run on HF Jobs with SmolLM3-3B (default)hf jobs uv run \--flavor l4x1 \--image vllm/vllm-openai:latest \https://huggingface.co/datasets/uv-scripts/classification/raw/main/classify-dataset.py \--input-dataset user/support-tickets \--column content \--labels "bug,feature_request,question,other" \4 unmodified lines### News Categorization```bash# Using SmolLM3-3B for efficient news classificationhf jobs uv run \--flavor l4x1 \--image vllm/vllm-openai:latest \https://huggingface.co/datasets/uv-scripts/classification/raw/main/classify-dataset.py \--input-dataset ag_news \--column text \--labels "world,sports,business,tech" \--output-dataset user/ag-news-categorized```### Complex Classification with Reasoning```bash# SmolLM3's thinking mode for nuanced feedback analysishf jobs uv run \--flavor l4x1 \--image vllm/vllm-openai:latest \https://huggingface.co/datasets/uv-scripts/classification/raw/main/classify-dataset.py \--input-dataset user/customer-feedback \--column text \--labels "very_positive,positive,neutral,negative,very_negative" \21 unmodified lines--shuffle# With reasoning for nuanced classificationhf jobs uv run \--flavor l4x1 \--image vllm/vllm-openai:latest \https://huggingface.co/datasets/uv-scripts/classification/raw/main/classify-dataset.py \--input-dataset librarian-bots/arxiv-metadata-snapshot \--column abstract \--labels "multimodal,agents,reasoning,safety,efficiency" \22 unmodified lines```### GPU Flavors- `l4x1`: **Recommended starting point** - great for SmolLM3- `a10g-large`: More memory for larger batches or 7B+ models- `a100-large`: Maximum performance for demanding workloads## 🔧 Advanced Usage20 unmodified lines### Using Different ModelsBy default, this script uses **[HuggingFaceTB/SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B)** - a state-of-the-art 3B parameter model specifically designed for efficient inference. SmolLM3 features:- Native thinking capabilities with `<think>` tags for step-by-step reasoning- Excellent performance on classification tasks- Fast inference speed (50-100 texts/second on A10)- Low memory footprint allowing larger batch sizesWhile you can use other models, SmolLM3 is recommended for its balance of quality, speed, and reasoning capabilities:```bash# Larger model for complex classification
README.md+33-15