Skip to content

Commit 324f252

Browse files
🐛 fix for upstream compatibility - use LLM.embed() instead for embeddings (#188)
- `LLM.embed()` is the preferred way of returning embeddings. - `engine_core.step()` now returns a `tuple` --------- Signed-off-by: Prashant Gupta <[email protected]>
1 parent 9eb633e commit 324f252

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/e2e/test_spyre_cb.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,4 +473,9 @@ def test_scheduler_cb_steps_tkv(model: str, backend: str,
473473
f"Step {step}, finished request output"
474474

475475
# Perform next step
476-
request_outputs = engine_core.step().outputs
476+
step_output = engine_core.step()
477+
# backward compatibility
478+
if isinstance(step_output, tuple):
479+
request_outputs = step_output[0].outputs
480+
else:
481+
request_outputs = step_output.outputs

tests/spyre_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def spyre_vllm_embeddings(model: str, prompts: list[str],
408408
block_size=block_size,
409409
tensor_parallel_size=tensor_parallel_size)
410410

411-
vllm_outputs = vllm_model.encode(prompts)
411+
vllm_outputs = vllm_model.embed(prompts)
412412

413413
results = []
414414
for req_output in vllm_outputs:

0 commit comments

Comments
 (0)