From 403fd58348e57521425f901207c8c98abff1bb5d Mon Sep 17 00:00:00 2001 From: Anton Polishko Date: Mon, 6 Jan 2025 10:01:36 -0800 Subject: [PATCH] made it more pythonic --- lm_eval/models/huggingface.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lm_eval/models/huggingface.py b/lm_eval/models/huggingface.py index 55e0efbe98..b55ef400f3 100644 --- a/lm_eval/models/huggingface.py +++ b/lm_eval/models/huggingface.py @@ -637,8 +637,7 @@ def _create_model( # check if peft contains peft revision according to "adapter_id@revision" format (f.e. used in [TGI endpoints](https://huggingface.co/docs/text-generation-inference/main/en/conceptual/lora#specifying-lora-models)) if "@" in peft: - peft = peft.split("@")[0] - peft_revision = peft.split("@")[1] + peft, peft_revision = peft.split("@", 1) self._model = PeftModel.from_pretrained( self._model, peft, revision=peft_revision )