resolve_hub_revision#
- scikitplot.corpus.resolve_hub_revision(model_name, *, timeout=None)[source]#
Return the Hugging Face Hub commit a model id currently points to.
- Parameters:
- model_namestr
A full Hub repository id,
"owner/name".- timeoutfloat or None, default=None
Request timeout in seconds, passed to the Hub client.
- Returns:
- str
The commit hash (
huggingface_hub.model_info(model_name).sha).
- Raises:
- ValueError
If
model_nameis not"owner/name"(a short name such as"all-MiniLM-L6-v2"is completed by sentence-transformers’ own rules, which this function does not guess), is an existing local directory, or the Hub reports no commit.- ImportError
If
huggingface_hubis not installed.
- Parameters:
- Return type:
Notes
User. The engine loads the revision this returns, so the cache key, the manifest and the model agree. It needs the network once per engine.