Skip to content

Commit a03f5de

Browse files
committed
fixing MTBench/fastchat/modules/xfastertransformer
1 parent 63f4f33 commit a03f5de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eval/chat_benchmarks/MTBench/fastchat/modules/xfastertransformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def load_xft_model(model_path, xft_config: XftConfig):
3636
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, padding_side="left", trust_remote_code=True)
3737
xft_model = xfastertransformer.AutoModel.from_pretrained(model_path, dtype=data_type)
3838
model = XftModel(xft_model=xft_model, xft_config=xft_config)
39-
if model.model.accelerator.process_index > 0:
39+
if (hasattr(model.model, "accelerator") and model.model.accelerator.process_index > 0) or model.model.rank > 0:
4040
while True:
4141
model.model.generate()
4242
return model, tokenizer

0 commit comments

Comments
 (0)