Skip to content

Commit b42fa89

Browse files
committed
Add environment variable to possibly tune the memory usage of the judge LLM (to avoid some memory errors)
1 parent af9f3ee commit b42fa89

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/lighteval/metrics/utils/llm_as_judge.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import asyncio
2525
import logging
26+
import os
2627
import time
2728
from concurrent.futures import ThreadPoolExecutor
2829
from dataclasses import dataclass
@@ -172,7 +173,12 @@ def __lazy_load_client(self): # noqa: C901
172173

173174
self.sampling_params = SamplingParams(temperature=0.8, top_p=0.95, max_tokens=self.max_tokens)
174175
self.tokenizer = get_tokenizer(self.model, tokenizer_mode="auto")
175-
self.pipe = LLM(model=self.model, max_model_len=65536, gpu_memory_utilization=0.8, dtype="float16")
176+
self.pipe = LLM(
177+
model=self.model,
178+
max_model_len=int(os.environ.get("LIGHTEVAL_JUDGE_MAX_MODEL_LEN", 65536)),
179+
gpu_memory_utilization=float(os.environ.get("LIGHTEVAL_JUDGE_GPU_MEM_UTIL", 0.8)),
180+
dtype="float16",
181+
)
176182
return self.__call_vllm
177183

178184
case "transformers":

0 commit comments

Comments
 (0)