File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
qa/L0_backend_python/model_control Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 28
28
29
29
import json
30
30
import os
31
+ import subprocess
31
32
import sys
32
33
33
34
sys .path .append ("../../common" )
@@ -112,10 +113,8 @@ def _send_load_model_request(self, model_name):
112
113
113
114
url = f"http://{ self ._triton_host } :{ self ._triton_port } /v2/repository/models/{ model_name } /load"
114
115
115
- # Create a temporary file for the JSON payload
116
- with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".json" , delete = False ) as f :
117
- json .dump (payload , f )
118
- payload_file = f .name
116
+ # Convert payload to JSON string
117
+ payload_json = json .dumps (payload )
119
118
120
119
try :
121
120
# Use curl to send the request
@@ -129,7 +128,7 @@ def _send_load_model_request(self, model_name):
129
128
"-H" ,
130
129
"Content-Type: application/json" ,
131
130
"-d" ,
132
- f"@ { payload_file } " ,
131
+ payload_json ,
133
132
"--connect-timeout" ,
134
133
"10" ,
135
134
]
@@ -184,12 +183,6 @@ def __init__(self, error_msg):
184
183
self .content = self .text .encode ()
185
184
186
185
return ErrorResponse (str (e ))
187
- finally :
188
- # Clean up temporary file
189
- try :
190
- os .unlink (payload_file )
191
- except :
192
- pass
193
186
194
187
def test_invalid_character_model_names (self ):
195
188
"""Test that model names with invalid characters are properly rejected"""
You can’t perform that action at this time.
0 commit comments