From bc0baab2ea8f806961dd3fb9f534cfeb59a2e1fc Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Wed, 20 Mar 2024 14:14:32 +0200 Subject: [PATCH] server : allow to override -ngl in tests (#6170) --- examples/server/tests/features/steps/steps.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/server/tests/features/steps/steps.py b/examples/server/tests/features/steps/steps.py index 40c97001a..42cdd8985 100644 --- a/examples/server/tests/features/steps/steps.py +++ b/examples/server/tests/features/steps/steps.py @@ -24,12 +24,16 @@ from prometheus_client import parser def step_server_config(context, server_fqdn, server_port): context.server_fqdn = server_fqdn context.server_port = int(server_port) + context.n_gpu_layer = None if 'PORT' in os.environ: context.server_port = int(os.environ['PORT']) print(f"$PORT set, overriding server port with to {context.server_port}") if 'FQDN' in os.environ: context.server_fqdn = os.environ['FQDN'] print(f"$FQDN set, overriding server fqdn with to {context.server_fqdn}") + if 'N_GPU_LAYERS' in os.environ: + context.n_gpu_layer = int(os.environ['N_GPU_LAYERS']) + print(f"$N_GPU_LAYERS set, overriding n_gpu_layer with to {context.n_gpu_layer}") context.base_url = f'http://{context.server_fqdn}:{context.server_port}' @@ -41,7 +45,6 @@ def step_server_config(context, server_fqdn, server_port): context.n_ctx = None context.n_ga = None context.n_ga_w = None - context.n_gpu_layer = None context.n_predict = None context.n_prompts = 0 context.n_server_predict = None