From 343c9e8c9b3aadf59549ffdf9b37cfd87303d41e Mon Sep 17 00:00:00 2001 From: FangYin Cheng Date: Thu, 26 Oct 2023 15:20:06 +0800 Subject: [PATCH] fix(model): Fix some model missing stop tokens bug --- pilot/model/model_adapter.py | 1 + pilot/scene/chat_factory.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pilot/model/model_adapter.py b/pilot/model/model_adapter.py index 57e3cf251..3809729bc 100644 --- a/pilot/model/model_adapter.py +++ b/pilot/model/model_adapter.py @@ -164,6 +164,7 @@ class LLMModelAdaper: # Overwrite model params: params["stop"] = conv.stop_str + params["stop_token_ids"] = conv.stop_token_ids return params, model_context diff --git a/pilot/scene/chat_factory.py b/pilot/scene/chat_factory.py index e50e56efd..40bc89135 100644 --- a/pilot/scene/chat_factory.py +++ b/pilot/scene/chat_factory.py @@ -21,7 +21,7 @@ class ChatFactory(metaclass=Singleton): implementation = None for cls in chat_classes: if cls.chat_scene == chat_mode: - metadata = {"cls": str(cls), "params": kwargs} + metadata = {"cls": str(cls)} with root_tracer.start_span( "get_implementation_of_chat", metadata=metadata ):