huggingface¶
huggingface
¶
CheckpointUnreachable
¶
Bases: Exception
The checkpoint could not be read — the Hub was slow, down, or refused.
Distinct from reading it and finding nothing, which every reader here
reports as None. Collapsing the two is how a network problem comes to
look like a fact about a model: a config that failed to download makes
max_tp_size return None, and None is the answer meaning "this
model cannot be split at all", so a perfectly shardable model gets placed
across cards layer-by-layer and nothing says why.
HuggingFaceModel
¶
Bases: Remotable
nnsight wrapper around a HuggingFace Hub model.
Builds the architecture on the meta device from the repo's config and loads
real weights on dispatch, both via transformers. The transformers auto class
is configurable through AUTO_CLASS so subclasses can target, e.g.,
AutoModelForCausalLM.
| PARAMETER | DESCRIPTION |
|---|---|
repo_id
|
A HuggingFace repo id (e.g. "openai-community/gpt2") or an already-loaded torch.nn.Module.
TYPE:
|
revision
|
Optional git revision (branch/tag/commit) of the repo.
TYPE:
|