Skip to content

Commit d656d7c

Browse files
committed
remove _torch import
Signed-off-by: NickLucche <nlucches@redhat.com>
1 parent d3ef529 commit d656d7c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

vllm_bart_plugin/bart.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,9 +1082,8 @@ def _call_hf_processor(
10821082
# In vLLM >=0.18 the rendering pipeline may call _call_hf_processor
10831083
# with an already-tokenized prompt (a list of ints) instead of a str.
10841084
# Handle both cases.
1085-
import torch as _torch
10861085
if isinstance(prompt, (list, tuple)) and len(prompt) > 0 and isinstance(prompt[0], int):
1087-
result["input_ids"] = _torch.tensor([prompt])
1086+
result["input_ids"] = torch.tensor([prompt])
10881087
else:
10891088
prompt_tokenized = tokenizer(
10901089
prompt if prompt else "",

0 commit comments

Comments
 (0)