(device_type: str)
| 459 | |
| 460 | |
| 461 | def try_import_deeplink(device_type: str): |
| 462 | deeplink_device_type_list = [ |
| 463 | 'ascend', |
| 464 | 'npu', |
| 465 | 'maca', |
| 466 | 'camb', |
| 467 | ] |
| 468 | if device_type in deeplink_device_type_list: |
| 469 | try: |
| 470 | import dlinfer.framework.lmdeploy_ext # noqa: F401 |
| 471 | except Exception as e: |
| 472 | logger = get_logger('lmdeploy') |
| 473 | logger.error(f'{type(e).__name__}: {e}') |
| 474 | exit(1) |
| 475 | |
| 476 | |
| 477 | def serialize_state_dict(state_dict: dict) -> str: |
no test coverage detected