Compare commits

...

2 Commits

Author SHA1 Message Date
Lucas Armand c05131cd14 explicit not None check 2025-12-15 19:55:43 -08:00
Lucas Armand ebaf3b6d3a Add fix 2025-12-15 19:51:27 -08:00
+8
View File
@@ -28,6 +28,12 @@ MODEL_INFO_LOG_MSGS = [
nltk.download("words") nltk.download("words")
WORD_LIST = nltk.corpus.words.words() WORD_LIST = nltk.corpus.words.words()
def request_parser(request):
data = request
if request.get("input") is not None:
data = request.get("input")
return data
def completions_benchmark_generator() -> dict: def completions_benchmark_generator() -> dict:
prompt = " ".join(random.choices(WORD_LIST, k=int(250))) prompt = " ".join(random.choices(WORD_LIST, k=int(250)))
@@ -55,6 +61,7 @@ worker_config = WorkerConfig(
workload_calculator= lambda data: data.get("max_tokens", 0), workload_calculator= lambda data: data.get("max_tokens", 0),
allow_parallel_requests=True, allow_parallel_requests=True,
max_queue_time=60.0, max_queue_time=60.0,
request_parser=request_parser,
benchmark_config=BenchmarkConfig( benchmark_config=BenchmarkConfig(
generator=completions_benchmark_generator, generator=completions_benchmark_generator,
concurrency=100, concurrency=100,
@@ -66,6 +73,7 @@ worker_config = WorkerConfig(
workload_calculator= lambda data: data.get("max_tokens", 0), workload_calculator= lambda data: data.get("max_tokens", 0),
allow_parallel_requests=True, allow_parallel_requests=True,
max_queue_time=60.0, max_queue_time=60.0,
request_parser=request_parser
) )
], ],
log_action_config=LogActionConfig( log_action_config=LogActionConfig(