Text Generation
Transformers
PyTorch
Safetensors
GGUF
English
collision
conversational
rag
reasoning
deepseek-r1-style
system-2
agent
ollama
llama.cpp
fastapi
openai-compatible
slm
edge-ai
cpu-first
in-house-nlp
math
keyphrase-extraction
topic-classification
grammar-correction
reading-comprehension
sentiment-analysis
research
educational
custom_code
Instructions to use collision-10M/Collision-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use collision-10M/Collision-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="collision-10M/Collision-1B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("collision-10M/Collision-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use collision-10M/Collision-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "collision-10M/Collision-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "collision-10M/Collision-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/collision-10M/Collision-1B
- SGLang
How to use collision-10M/Collision-1B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "collision-10M/Collision-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "collision-10M/Collision-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "collision-10M/Collision-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "collision-10M/Collision-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use collision-10M/Collision-1B with Docker Model Runner:
docker model run hf.co/collision-10M/Collision-1B
File size: 4,261 Bytes
ddc12cc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | import os
import json
from data.stats import get_latest_version_dir
def evaluate_health(meta):
token_count = meta.get("token_count", 0)
vocab_size = meta.get("vocabulary_size", 0)
dup_count = meta.get("duplicate_count", 0)
num_docs = meta.get("number_of_documents", 1)
dup_rate = dup_count / max(1, num_docs + dup_count)
warnings = meta.get("quality_warnings", {})
score = "HIGH"
reasons = []
# 1. Size evaluation
if token_count < 100_000:
score = "LOW"
reasons.append("Dataset token count is extremely small (< 100K tokens).")
elif token_count < 1_000_000:
score = "MEDIUM"
reasons.append("Dataset size is small (< 1M tokens) for training a reliable Transformer model.")
# 2. Vocabulary evaluation
if vocab_size < 300:
score = "LOW"
reasons.append(f"Vocabulary size is very restricted ({vocab_size} tokens), suggesting repetitive text patterns.")
elif vocab_size < 1000 and score == "HIGH":
score = "MEDIUM"
reasons.append(f"Moderate vocabulary diversity ({vocab_size} tokens).")
# 3. Cleanliness/Deduplication evaluation
if dup_rate > 0.30:
score = "LOW"
reasons.append(f"Extremely high rate of duplicate documents ({dup_rate:.1%}).")
elif dup_rate > 0.10 and score == "HIGH":
score = "MEDIUM"
reasons.append(f"Moderate duplicate rate ({dup_rate:.1%}).")
# 4. Quantity of warnings
if len(warnings) > (num_docs * 0.2) and score == "HIGH":
score = "MEDIUM"
reasons.append("More than 20% of documents have quality warnings (e.g. extremely short or symbols-heavy).")
if not reasons:
reasons.append("Large token size, healthy vocabulary diversity, and low duplication rates.")
return score, reasons
def main():
latest_dir = get_latest_version_dir()
if not latest_dir:
print("No prepared dataset versions found. Please run 'python -m data.build' first.")
return
meta_path = os.path.join(latest_dir, "metadata.json")
if not os.path.exists(meta_path):
print(f"Error: metadata.json missing in {latest_dir}")
return
with open(meta_path, "r", encoding="utf-8") as f:
meta = json.load(f)
token_count = meta.get("token_count", 0)
classification = ""
if token_count < 100_000:
classification = "TESTING ONLY"
elif 100_000 <= token_count < 1_000_000:
classification = "SMALL"
elif 1_000_000 <= token_count < 5_000_000:
classification = "GOOD FOR FIRST EXPERIMENT"
elif 5_000_000 <= token_count < 10_000_000:
classification = "STRONG SMALL-MODEL DATASET"
else:
classification = "EXTENDED EXPERIMENT"
health_score, justifications = evaluate_health(meta)
# Compile warnings list
q_warnings = meta.get("quality_warnings", {})
warnings_list = []
for doc, warns in q_warnings.items():
for w in warns:
warnings_list.append(f"[{doc}] {w}")
print("================================")
print("COLLISION DATASET REPORT")
print("========================\n")
print(f"Dataset: {meta.get('dataset_version', 'N/A')}")
print(f"Documents: {meta.get('number_of_documents', 0):,}")
print(f"Characters: {meta.get('character_count', 0):,}")
print(f"Total Tokens: {token_count:,}")
print(f"Training Tokens: {meta.get('train_tokens', 0):,}")
print(f"Validation Tokens: {meta.get('validation_tokens', 0):,}")
print(f"Vocabulary: {meta.get('vocabulary_size', 0)}")
print(f"Duplicate Documents:{meta.get('duplicate_count', 0):,}")
print(f"Quality Warnings: {len(warnings_list)}")
print()
print("================================")
print(f"CLASSIFICATION: {classification}")
print(f"HEALTH SCORE: {health_score}")
print("================================")
print("Health Justifications:")
for j in justifications:
print(f" - {j}")
if warnings_list:
print("\nQuality Warnings Log (Top 10):")
for log in warnings_list[:10]:
print(f" - {log}")
if __name__ == "__main__":
main()
|