(named_parameters)
| 89 | |
| 90 | |
| 91 | def count_trainable_parameters(named_parameters): |
| 92 | total_trainable = 0 |
| 93 | total_untrainable = 0 |
| 94 | for name, param in named_parameters: |
| 95 | if param.requires_grad: |
| 96 | total_trainable += param.numel() |
| 97 | else: |
| 98 | total_untrainable += param.numel() |
| 99 | return total_trainable, total_untrainable |
| 100 | |
| 101 | |
| 102 | def load_safetensors(in_path: str): |
nothing calls this directly
no outgoing calls
no test coverage detected