File size: 1,529 Bytes
a0098d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Neural Network Quantizer
emoji: 
colorFrom: indigo
colorTo: purple
sdk: docker
pinned: false
license: mit
app_port: 7860
---

# Neural Network Weight Quantizer

Quantize neural network weights to lower precision formats (INT8, INT4, NF4) with interactive visualizations.

## Features

- 🔢 Multi-bit quantization (4-bit, 8-bit)
- 📊 Interactive weight visualizations
- 🤗 HuggingFace model support (optional)
- ⚡ GPU acceleration (when available)
- 📈 Quantization error analysis
- 🔄 Method comparison (INT8 vs INT4 vs NF4)

## Quick Start

1. Use the **Quantizer** tab to test on random weights
2. Compare different methods in the **Analysis** tab
3. Optionally load a HuggingFace model in the **Models** tab

## API

The backend exposes a REST API at `/api`:

- `GET /api/system/info` - System capabilities
- `POST /api/quantize/weights` - Quantize custom weights
- `POST /api/models/load` - Load HuggingFace model
- `POST /api/analysis/compare` - Compare methods

## 🚀 Deployment

### Hugging Face Spaces
This project is configured for **Hugging Face Spaces** using the Docker SDK.

1. Create a new Space on [Hugging Face](https://huggingface.co/new-space).
2. Select **Docker** as the SDK.
3. Push this repository to your Space:
   ```bash
   git remote add space https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
   git push space main
   ```

### Docker
Run locally with Docker:
```bash
docker build -t quantizer .
docker run -p 7860:7860 quantizer
```
Open `http://localhost:7860`.