Skip to content

Commit

Permalink
Raise the error if importing bench target fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuayao committed Oct 25, 2024
1 parent f037315 commit 97ee33c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions evals/benchmark/stresscli/locust/aistress.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ def on_locust_init(environment, **_kwargs):
os.environ["OPEA_EVAL_PROMPTS"] = environment.parsed_options.prompts
os.environ["OPEA_EVAL_MAX_OUTPUT_TOKENS"] = str(environment.parsed_options.max_output)
os.environ["LLM_MODEL"] = environment.parsed_options.llm_model
try:
bench_package = __import__(environment.parsed_options.bench_target)
except ImportError:
return None

bench_package = __import__(environment.parsed_options.bench_target)

if not isinstance(environment.runner, WorkerRunner):
gevent.spawn(checker, environment)
environment.runner.register_message("worker_reqdata", on_reqdata)
Expand Down

0 comments on commit 97ee33c

Please sign in to comment.