mishig HF Staff commited on
Commit
beb5dbc
·
verified ·
1 Parent(s): 1daaafd

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -0
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GGUF Header Edit Benchmark
2
+
3
+ Benchmark script for measuring how long it takes to **edit GGUF headers in-place** on Hugging Face with streaming blobs (xet) and create a **pull request** per file.
4
+ It fetches metadata, rebuilds the header with a small change, commits an edit (header slice only), and records timings to a CSV.
5
+
6
+ > **Rule of thumb (linear fit):**
7
+ > time_minutes ≈ `0.36 × size_GB + 0.25`
8
+
9
+ ---
10
+
11
+ ## ✨ What this does
12
+
13
+ For each `*.gguf` file in a model repo:
14
+
15
+ 1. **Discover files** via the Hugging Face model tree API.
16
+ 2. **Fetch GGUF + typed metadata** with `@huggingface/gguf`.
17
+ 3. **Rebuild the header** using `buildGgufHeader` (preserving endianness, alignment, and tensor info range).
18
+ 4. **Commit a slice edit** (header bytes only) using `commitIter` with `useXet: true` to avoid full re-uploads.
19
+ 5. **Create a PR** titled `benchmark`.
20
+ 6. **Record timing** (wall-clock) to `benchmark-results.csv`.
21
+
22
+ ---
23
+
24
+ ## 🧱 Requirements
25
+
26
+ - Node 18+
27
+ - A Hugging Face token with **read + write** on the target repo: `HF_TOKEN`
28
+ - NPM packages:
29
+ - `@huggingface/gguf`
30
+ - `@huggingface/hub`
31
+ - Network access to `huggingface.co`
32
+
33
+ ---
34
+
35
+ ## 🔧 Setup
36
+
37
+ ```bash
38
+ pnpm add @huggingface/gguf @huggingface/hub
39
+ # or: npm i @huggingface/gguf @huggingface/hub