fix(grok): adapt huihui-ai/grok-2 (#21522)

Co-authored-by: Jianzhao Xu <xujianchao@huawei.com>
This commit is contained in:
jianzhao-xu
2026-04-07 10:04:41 +08:00
committed by GitHub
co-authored by Jianzhao Xu
parent 494bb86169
commit 73fc87a74f
+3
View File
@@ -983,6 +983,9 @@ def _prepare_presharded_weights(
for pattern in allow_patterns:
hf_weights_files += glob.glob(os.path.join(hf_folder, pattern))
if not hf_weights_files:
return old_prepare_weights(self, model_name_or_path, revision, fall_back_to_pt)
if hf_weights_files[0].endswith("safetensors"):
use_safetensors = True
else: