MCPcopy Index your code
hub / github.com/XPixelGroup/DiffBIR / load_from_hf

Function load_from_hf

llava/model/builder.py:69–74  ·  view source on GitHub ↗
(repo_id, filename, subfolder=None)

Source from the content-addressed store, hash-verified

67 # this is probably from HF Hub
68 from huggingface_hub import hf_hub_download
69 def load_from_hf(repo_id, filename, subfolder=None):
70 cache_file = hf_hub_download(
71 repo_id=repo_id,
72 filename=filename,
73 subfolder=subfolder)
74 return torch.load(cache_file, map_location='cpu')
75 non_lora_trainables = load_from_hf(model_path, 'non_lora_trainables.bin')
76 non_lora_trainables = {(k[11:] if k.startswith('base_model.') else k): v for k, v in non_lora_trainables.items()}
77 if any(k.startswith('model.model.') for k in non_lora_trainables):

Callers 1

load_pretrained_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected