Skip to content

Commit 6bb923e

Browse files
committed
docs: document Python deps for SafeTensors to GGUF conversion
Add required packages (torch, safetensors, gguf, transformers) and optional model-specific imports in internal/convert/data/README.md. Summarize the same install step in the root README under Model Formats. Made-with: Cursor
1 parent df4ce6a commit 6bb923e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ csghub-lite config set server_url https://my-private-csghub.example.com
214214
| GGUF | Yes | Yes (via llama.cpp) |
215215
| SafeTensors | Yes | Yes (auto-converted to GGUF) |
216216

217+
SafeTensors checkpoints are converted once using the bundled llama.cpp `convert_hf_to_gguf.py` and **system Python** (PyTorch is not shipped inside the release binary). Install these packages once:
218+
219+
```bash
220+
pip3 install torch safetensors gguf transformers
221+
```
222+
223+
Use Python 3.10+ on `PATH` (Windows: `python` or `python3`). Some models may need extra packages (for example `sentencepiece`); see [`internal/convert/data/README.md`](internal/convert/data/README.md) for the full list and troubleshooting (`gguf` version mismatch, optional `CSGHUB_LITE_CONVERTER_URL`).
224+
217225
## Development
218226

219227
```bash

internal/convert/data/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,33 @@ This file is embedded into the `csghub-lite` binary (`go:embed`) so SafeTensors
2020
3. Update **`BundledConverterLLamacppRef`** and the table above.
2121

2222
Optional: set **`CSGHUB_LITE_CONVERTER_URL`** at runtime to a raw mirror URL instead of using the embedded file.
23+
24+
## Python runtime dependencies
25+
26+
`csghub-lite` materializes this script and runs it with a system **Python 3** interpreter. The binary pre-checks imports before conversion (`internal/convert/convert_python.go`); all of the following must be importable:
27+
28+
| Package | Role |
29+
|---------|------|
30+
| `torch` | Load tensors / weights |
31+
| `safetensors` | Read `.safetensors` checkpoints |
32+
| `gguf` | Write GGUF; if the script fails with `AttributeError` involving `MODEL_ARCH` or `gguf`, upgrade: `pip3 install -U gguf` |
33+
| `transformers` | `AutoConfig`, tokenizers, etc. |
34+
35+
One-time install (same as the CLI error text):
36+
37+
```bash
38+
pip3 install torch safetensors gguf transformers
39+
```
40+
41+
On macOS/Linux the tool tries `python3.13``python3.10`, then `python3` / `python`, plus common Homebrew paths. On Windows it looks for `python` / `python3` on `PATH`.
42+
43+
### Optional / model-specific imports
44+
45+
The upstream script may import extra packages for certain architectures. These are **not** verified up front; install if conversion fails with `ModuleNotFoundError`:
46+
47+
| Package | When needed |
48+
|---------|----------------|
49+
| `numpy` | Used by the script; usually already installed with `torch` |
50+
| `sentencepiece` | Some SentencePiece-based tokenizers |
51+
| `huggingface_hub` | e.g. `snapshot_download` paths in the converter |
52+
| `mistral_common` | Some Mistral flows; upstream suggests `pip install mistral-common[image,audio]` |

0 commit comments

Comments
 (0)