Skip to content

Load safetensors with i8#3042

Merged
greenrazer merged 1 commit into
huggingface:mainfrom
chadvoegele:load_safetensors_i8
Aug 5, 2025
Merged

Load safetensors with i8#3042
greenrazer merged 1 commit into
huggingface:mainfrom
chadvoegele:load_safetensors_i8

Conversation

@chadvoegele

Copy link
Copy Markdown
Contributor

Hi,

I have a small ML-enabled app that uses candle with wasm under the hood. Downloading the model takes a long time so I quantized it to 8-bit integers. Candle doesn't have an I8 DType and the safetensors load doesn't support I8.

This PR adds the ability to load a safetensors file with I8 by upcasting it to I64, similar to the existing I32 to I64 conversion.

Based on this PR for adding a DType::I32, I skipped adding a DType::I8 for now, but would consider that if requested.

Thanks!

@chadvoegele chadvoegele marked this pull request as ready for review August 1, 2025 11:34
@chadvoegele chadvoegele changed the title Load safetensors i8 Load safetensors with i8 Aug 1, 2025
@greenrazer greenrazer self-assigned this Aug 5, 2025
@greenrazer

Copy link
Copy Markdown
Contributor

Thanks!

@greenrazer greenrazer merged commit 86bcf1e into huggingface:main Aug 5, 2025
9 checks passed
john-sharratt pushed a commit to john-sharratt/candle that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants