Skip to content

Commit

Permalink
Handle the naming of the (HF_)TOKEN variable
Browse files Browse the repository at this point in the history
Demo leaderboard & backend had sometimes had TOKEN, sometimes HF_TOKEN as the relevant variable name. We standardized to TOKEN, but creating an inference endpoint via the demo leaderboard won't work because this lighteval code (which the demo leaderboard calls to) expects the variable to be named HF_TOKEN. Here I propose a solution that will adapt to the TOKEN name, but not break any other dependencies that assume HF_TOKEN.
  • Loading branch information
meg-huggingface authored Jul 9, 2024
1 parent 0528f29 commit 2232fac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lighteval/main_accelerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if not is_accelerate_available() and not is_tgi_available():
hlog_warn("Using either accelerate or text-generation to run this script is advised.")

TOKEN = os.getenv("HF_TOKEN")
TOKEN = os.gentenv("HF_TOKEN") if os.gentenv("HF_TOKEN") is not None else os.getenv("TOKEN")
CACHE_DIR = os.getenv("HF_HOME")

if is_accelerate_available():
Expand Down

0 comments on commit 2232fac

Please sign in to comment.