Skip to content

Commit cb64cd5

Browse files
committed
Update
[ghstack-poisoned]
1 parent 19cc931 commit cb64cd5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torchrl/modules/llm/vllm_policy.py

+5
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ def from_vllm(
116116
Transformers library.
117117
118118
"""
119+
try:
120+
from vllm import SamplingParams
121+
except ImportError:
122+
raise ImportError("Please install `vllm` to use `from_vllm`.")
123+
119124
text_key: NestedKey = ("text",)
120125
token_key: NestedKey = ("tokens",)
121126
attention_mask_key: NestedKey = ("attention_mask",)

0 commit comments

Comments
 (0)