Skip to content

Commit 05d876e

Browse files
committed
use fastchat github version for latest conversation templates; add warning messages if the retrieved conversation template is the default one
1 parent 25cdf85 commit 05d876e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pe/llm/huggingface/huggingface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ def __init__(self, model_name_or_path, batch_size=128, dry_run=False, **generati
4545
self._model.eval()
4646

4747
self._conv_template = self._get_conv_template()
48+
if self._conv_template.name == "one_shot":
49+
execution_logger.warning(
50+
"The conversation template is the default one_shot. Likely the conversation template is not set "
51+
"correctly. Please check if the installed fastchat library is the latest version on GitHub, or if the "
52+
"conversation template is registered. See "
53+
"https://microsoft.github.io/DPSDA/api/pe.llm.html#pe.llm.HuggingfaceLLM"
54+
)
4855
self._stop_str = self._conv_template.stop_str
4956
self._stop_token_ids = self._conv_template.stop_token_ids or []
5057
self._stop_token_ids.append(self._tokenizer.eos_token_id)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ text = [
4747
"sentence-transformers",
4848
"protobuf",
4949
"sentencepiece",
50-
"fschat",
50+
"fschat@git+https://github.com/lm-sys/FastChat.git",
5151
"transformers",
5252
"accelerate",
5353
"tqdm",

0 commit comments

Comments
 (0)