Skip to content

Commit a4fdb39

Browse files
[BugFix] Fix vocab size error for ernie model (#2785)
* [BugFix] Fix vocab size error for ernie model * [BugFix] Fix vocab size error for ernie model --------- Co-authored-by: Jiang-Jia-Jun <jiangjiajun@baidu.com>
1 parent 2a86928 commit a4fdb39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fastdeploy/worker/worker_process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,8 @@ def initialize_fd_config(config_or_args) -> FDConfig:
735735

736736
# Handle vocabulary size
737737
model_config.ori_vocab_size = model_config_dict.get("vocab_size", -1)
738-
if "Ernie4_5_ForCausalLM" in model_config_dict.get("architectures", []):
738+
archs = model_config_dict.get("architectures", [])
739+
if "Ernie4_5_ForCausalLM" in archs or "Ernie4_5_MoeForCausalLM" in archs:
739740
model_config.ori_vocab_size = getattr(config_or_args, 'ori_vocab_size', model_config.ori_vocab_size)
740741

741742
# Handle DeepseekV3 specific config

0 commit comments

Comments
 (0)