From c199c8d90ec0b932efd5b2fd051045562013ce49 Mon Sep 17 00:00:00 2001 From: lewtun Date: Sun, 26 Nov 2023 07:05:58 +0100 Subject: [PATCH] Fix Hermes2Adapter (#2727) --- fastchat/model/model_adapter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index ee4fe573d..f94b5cf61 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -1481,9 +1481,9 @@ class Hermes2Adapter(BaseModelAdapter): use_fast_tokenizer = False def match(self, model_path: str): - return ( - "openhermes-2.5-mistral-7b" - or "openhermes-2-mistral-7b" in model_path.lower() + return any( + model_str in model_path.lower() + for model_str in ["openhermes-2.5-mistral-7b", "openhermes-2-mistral-7b"] ) def load_model(self, model_path: str, from_pretrained_kwargs: dict):