(repo_id, filename, subfolder=None)
| 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): |
no outgoing calls
no test coverage detected