Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 488 Bytes

notes.md

File metadata and controls

16 lines (13 loc) · 488 Bytes
  • Loading hf models, safetensor file, state_dict
# download model files
from huggingface_hub import snapshot_download
snapshot_download(repo_id="facebook/dinov2-small", local_dir="./model")

# load model state_dict
from safetensors.torch import load_file

filepath = "./model/model.safetensors"
state_dict = load_file(filepath)
#...ensure jax impl keys matches state_dict keys