Skip to content

Commit

Permalink
made it more pythonic
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpolishko authored Jan 6, 2025
1 parent aa3c937 commit 403fd58
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lm_eval/models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 403fd58

Please sign in to comment.