Skip to content

Commit d63d1d5

Browse files
committed
chore: add end-to-end identity model
Signed-off-by: Guan Luo <[email protected]>
1 parent 6e515a7 commit d63d1d5

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

lib/bindings/python/tests/test_tensor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ async def test_register(runtime: DistributedRuntime):
2222

2323
model_config = {
2424
"name": "tensor",
25-
"inputs": [{"name": "input", "data_type": "Bool", "shape": [1]}],
26-
"outputs": [],
25+
"inputs": [{"name": "input", "data_type": "Int32", "shape": [-1]}],
26+
"outputs": [{"name": "output", "data_type": "Int32", "shape": [-1]}],
2727
}
2828
runtime_config = ModelRuntimeConfig()
2929
runtime_config.set_tensor_model_config(model_config)
@@ -47,7 +47,8 @@ async def test_register(runtime: DistributedRuntime):
4747

4848

4949
async def generate(request, context):
50-
raise NotImplementedError
50+
print(f"Received request: {request}")
51+
yield {"model": request["model"], "tensors": request["tensors"]}
5152

5253

5354
if __name__ == "__main__":

lib/llm/tests/kserve_service.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,53 @@ pub mod kserve_test {
284284
manager
285285
.add_completions_model("split", split.clone())
286286
.unwrap();
287+
manager
288+
.save_model_entry("split", ModelEntry {
289+
name: "split".to_string(),
290+
endpoint_id: EndpointId {
291+
namespace: "namespace".to_string(),
292+
component: "component".to_string(),
293+
name: "split".to_string(),
294+
},
295+
model_type: ModelType::Completions,
296+
model_input: ModelInput::Text,
297+
runtime_config: None,
298+
});
299+
287300
manager
288301
.add_chat_completions_model("failure", failure.clone())
289302
.unwrap();
290303
manager
291304
.add_completions_model("failure", failure.clone())
292305
.unwrap();
306+
manager
307+
.save_model_entry("failure", ModelEntry {
308+
name: "failure".to_string(),
309+
endpoint_id: EndpointId {
310+
namespace: "namespace".to_string(),
311+
component: "component".to_string(),
312+
name: "failure".to_string(),
313+
},
314+
model_type: ModelType::Completions | ModelType::Chat,
315+
model_input: ModelInput::Text,
316+
runtime_config: None,
317+
});
293318
manager
294319
.add_completions_model("long_running", long_running.clone())
295320
.unwrap();
321+
manager
322+
.save_model_entry("failure", ModelEntry {
323+
name: "failure".to_string(),
324+
endpoint_id: EndpointId {
325+
namespace: "namespace".to_string(),
326+
component: "component".to_string(),
327+
name: "failure".to_string(),
328+
},
329+
model_type: ModelType::Completions,
330+
model_input: ModelInput::Text,
331+
runtime_config: None,
332+
});
333+
296334

297335
(service, split, failure, long_running)
298336
}

0 commit comments

Comments
 (0)