Views
No views yet
This quantization was performed autonomously by NEO - Your Autonomous AI Agent.
| Component | Original Size | Quantized Size | Compression |
|---|---|---|---|
| Model Weights | ~128.61 GB | ~4.34 GB | 27.6x |
| Total (with metadata) | ~128.61 GB | ~4.65 GB | 27.6x |
hf_export/
├── config.json # Model configuration
├── generation_config.json # Generation parameters
├── model.safetensors.index.json # Shard index mapping
├── model-00001-of-00026.safetensors # Quantized weights shard 1
├── model-00002-of-00026.safetensors # Quantized weights shard 2
├── ... (26 shards total)
├── tokenizer.json # Tokenizer vocabulary
├── tokenizer_config.json # Tokenizer configuration
├── special_tokens_map.json # Special token mappings
├── chat_template.jinja # Chat template
├── quantization_metadata.json # Quantization parameters
└── README.md # This file1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load tokenizer
5tokenizer = AutoTokenizer.from_pretrained("./hf_export")
6
7# Load quantized model
8# Note: This requires custom dequantization logic
9model = AutoModelForCausalLM.from_pretrained(
10 "./hf_export",
11 torch_dtype=torch.float16,
12 device_map="auto",
13 trust_remote_code=True
14)
15
16# Generate text
17inputs = tokenizer("Hello, how are you?", return_tensors="pt").to(model.device)
18outputs = model.generate(**inputs, max_new_tokens=100)
19print(tokenizer.decode(outputs[0]))1import torch
2from safetensors.torch import load_file
3
4def dequantize_1bit(tensor, scale):
5 """
6 Dequantize 1-bit weights using stored scales.
7
8 Args:
9 tensor: Packed 1-bit weights (uint8)
10 scale: Dequantization scale (FP16)
11
12 Returns:
13 Dequantized FP16 weights
14 """
15 # Unpack bits
16 bits = torch.unpackbits(tensor.view(torch.uint8))
17 # Convert to -1, 1 values
18 weights = bits.float() * 2 - 1
19 # Apply scale
20 return weights * scale| Metric | Value |
|---|---|
| Original FP16 Size | ~128.61 GB |
| Quantized Size | 4.34 GB |
| Compression Ratio | 27.6x |
| Target (<5GB) | ✓ Achieved |
1@misc{sarvam-30b-1bit,
2 title = {Sarvam-30B 1-bit Ultra-Quantized Model},
3 year = {2025},
4 note = {27.6x compression from FP16 (~128.61 GB) to 4.34 GB, performed autonomously by NEO (https://heyneo.so/)}
5}