Skip to content

maruel/n-bits-py

Repository files navigation

n-bits

Algorithms to better understand DNN (deep neural networks) weights.

Installation

pip install n_bits

Usage

Analyze Llama-3.2 1B:

n-bits analyze --hf-repo meta-llama/Llama-3.2-1B

As a Python Package

import huggingface_hub
import safetensors

from n_bits.analyze import graph_histogram

# Load a tensor
local_path = huggingface_hub.hf_hub_download(repo_id="meta-llama/Llama-3.2-1B", filename="model.safetensors")
tensors = safetensors.torch.load_file(local_path)
first_name = next(iter(tensors))
first = tensors[first_name]
graph_histogram(first, first_name)

Code coverage: codecov

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published