(saved_dict: Dict[str, Any])
| 566 | |
| 567 | |
| 568 | def get_state_dict(saved_dict: Dict[str, Any]) -> dict[str, Any]: |
| 569 | state_dict = saved_dict |
| 570 | if "model" in saved_dict.keys(): |
| 571 | state_dict = state_dict["model"] |
| 572 | if "module" in saved_dict.keys(): |
| 573 | state_dict = state_dict["module"] |
| 574 | if "state_dict" in saved_dict.keys(): |
| 575 | state_dict = state_dict["state_dict"] |
| 576 | return state_dict |
| 577 | |
| 578 | |
| 579 | def convert_transformer( |
no outgoing calls
no test coverage detected
searching dependent graphs…