Skip to content

Commit

Permalink
huggingface_local: Allow specifying model revision
Browse files Browse the repository at this point in the history
This is v0.6.6 but with
tatsu-lab#441 addressed: it allows
specifying the model revision to be evaluated under
`completions_kwargs`.
  • Loading branch information
tomtseng committed Feb 13, 2025
1 parent f19c323 commit e8d5c17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/alpaca_eval/decoders/huggingface_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def huggingface_local_completions(

default_kwargs = dict(
do_sample=do_sample,
model_kwargs={k: v for k, v in model_kwargs.items() if k != "trust_remote_code"},
model_kwargs={
k: v for k, v in model_kwargs.items() if k != "revision" and k != "trust_remote_code"
},
batch_size=batch_size,
)
default_kwargs.update(kwargs)
Expand All @@ -131,6 +133,7 @@ def huggingface_local_completions(
model=model,
tokenizer=tokenizer,
**default_kwargs,
revision=model_kwargs.get("revision", None),
trust_remote_code=model_kwargs.get("trust_remote_code", False),
)

Expand Down

0 comments on commit e8d5c17

Please sign in to comment.