mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[V1 Loader] Support DeepSeekV3(bf16) (#3294)
* Support new loader for DeepSeekV3(bf16) * update paddle version * remove useless attr
This commit is contained in:
@@ -78,9 +78,13 @@ def default_weight_loader(fd_config: FDConfig) -> None:
|
||||
if param.dtype != loaded_weight.dtype:
|
||||
loaded_weight = loaded_weight.cast(param.dtype)
|
||||
|
||||
assert param.shape == loaded_weight.shape, (
|
||||
f" Attempted to load weight ({loaded_weight.shape}) " f"into parameter ({param.shape})"
|
||||
)
|
||||
if param.shape != loaded_weight.shape:
|
||||
try:
|
||||
param = param.reshape(loaded_weight.shape)
|
||||
except ValueError as e:
|
||||
raise ValueError(
|
||||
f" Attempted to load weight ({loaded_weight.shape}) into parameter ({param.shape}). {e}"
|
||||
)
|
||||
|
||||
param.copy_(loaded_weight, False)
|
||||
except Exception:
|
||||
|
Reference in New Issue
Block a user