1- # Copyright 2024-2025 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+ # Copyright 2024-2026 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22#
33# Redistribution and use in source and binary forms, with or without
44# modification, are permitted provided that the following conditions
@@ -57,7 +57,6 @@ def test_completions_defaults(self, client, model: str, prompt: str):
5757 ("top_p" , 0.9 ),
5858 ("frequency_penalty" , 0.5 ),
5959 ("presence_penalty" , 0.2 ),
60- ("best_of" , 1 ),
6160 ("n" , 1 ),
6261 # logprobs is an integer for completions
6362 ("logprobs" , 5 ),
@@ -359,7 +358,12 @@ def test_no_prompt(self, client, model: str):
359358 ],
360359 )
361360 def test_completions_multiple_choices (
362- self , client , sampling_parameter_dict : dict , model : str , prompt : str
361+ self ,
362+ client ,
363+ sampling_parameter_dict : dict ,
364+ backend : str ,
365+ model : str ,
366+ prompt : str ,
363367 ):
364368 response = client .post (
365369 "/v1/completions" ,
@@ -370,7 +374,11 @@ def test_completions_multiple_choices(
370374 # FIXME: Add support and test for success
371375 # Expected to fail when n or best_of > 1, only single choice supported for now
372376 assert response .status_code == 400
373- assert "only single choice" in response .json ()["detail" ]
377+ if backend == "vllm" and "best_of" in sampling_parameter_dict :
378+ error_message = "best_of is no longer supported in vLLM backend"
379+ else :
380+ error_message = "only single choice"
381+ assert error_message in response .json ()["detail" ]
374382
375383 @pytest .mark .skip (reason = "Not Implemented Yet" )
376384 def test_lora (self ):
0 commit comments