소스 검색

feat: 初始化transpose_weight_keys为默认空列表

zhch158_admin 1 개월 전
부모
커밋
ecbcce9cf1
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      paddlex/inference/models/common/vlm/transformers/model_utils.py

+ 3 - 0
paddlex/inference/models/common/vlm/transformers/model_utils.py

@@ -1888,6 +1888,9 @@ class PretrainedModel(
         with ContextManagers(init_contexts):
             model = cls(config, *init_args, **model_kwargs)
 
+		# modified by zhch158
+        transpose_weight_keys = []  # ✅ 默认初始化
+
         if convert_from_torch and state_dict is None:
             if (
                 resolved_archive_file.endswith(PYTORCH_WEIGHTS_NAME)