Skip to content

Commit 6249dd1

Browse files
edwardquarmRaghul-M
authored andcommitted
feat(model-validation-v2-audio-feature): address coderabbit comments
1 parent e16727b commit 6249dd1

File tree

1 file changed

+3
-3
lines changed
  • tests/model_serving/model_runtime

1 file changed

+3
-3
lines changed

tests/model_serving/model_runtime/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def run_audio_inference(
114114
return model_info, completion_responses
115115
else:
116116
LOGGER.info("Using port forwarding for inference on pod: %s", pod_name)
117-
inference_client = OpenAIClient(host=f"http://localhost:{port}", model_name=model_name, streaming=True)
117+
if pod_name is None or isvc is None or port is None:
118+
raise ValueError("pod_name, isvc, and port are required when url is not provided")
118119

119120
with portforward.forward(
120121
pod_or_service=pod_name,
@@ -124,6 +125,7 @@ def run_audio_inference(
124125
):
125126
if endpoint == "openai":
126127
completion_responses = []
128+
inference_client = OpenAIClient(host=f"http://localhost:{port}", model_name=model_name, streaming=True)
127129
completion_response = inference_client.request_audio(
128130
endpoint=OpenAIEnpoints.AUDIO_TRANSCRIPTION, audio_file_path=audio_file_path, model_name=model_name
129131
)
@@ -167,7 +169,6 @@ def validate_raw_openai_inference_request(
167169
completion_query=completion_query,
168170
)
169171
validate_inference_output(
170-
model_info,
171172
completion_responses,
172173
response_snapshot=response_snapshot,
173174
)
@@ -238,7 +239,6 @@ def validate_serverless_openai_inference_request(
238239
url=url, model_name=model_name, completion_query=completion_query
239240
)
240241
validate_inference_output(
241-
model_info,
242242
completion_responses,
243243
response_snapshot=response_snapshot,
244244
)

0 commit comments

Comments
 (0)