@@ -48,6 +48,9 @@ class LLMEnv(EnvBase):
4848 Prompts to the language model can be loaded when the environment is ``reset`` if the environment is created via
4949 :meth:`~from_dataloader`.
5050
51+ .. note:: The default arguments of the `LLMEnv` class are set to make it easy to run this environment with
52+ the vllm backend (:class:`~torchrl.modules.vLLMWrapper`).
53+
5154 Keyword Args:
5255 token_key (NestedKey, optional): The key in the tensordict where the tokens are stored (when `str2str=False`).
5356 Defaults to ``"tokens"``.
@@ -59,7 +62,7 @@ class LLMEnv(EnvBase):
5962 ``"tokens_response"`` or ``"text_response"``.
6063 reward_key (NestedKey, optional): The key in the tensordict where the reward is stored if `assign_reward=True`.
6164 Defaults to ``"reward"``.
62- str2str (bool, optional): Whether the environment should expect strings as input and output. Defaults to ``False ``.
65+ str2str (bool, optional): Whether the environment should expect strings as input and output. Defaults to ``True ``.
6366 device (torch.device | None, optional): The device on which the environment should run. Defaults to ``None``.
6467 vocab_size (int | None, optional): The size of the vocabulary. If None, the environment will assume an
6568 unbounded vocabulary. Defaults to ``None``.
@@ -102,7 +105,7 @@ def __init__(
102105 attention_key : NestedKey | None = None ,
103106 action_key : NestedKey | None = None ,
104107 reward_key : NestedKey = "reward" ,
105- str2str : bool = False ,
108+ str2str : bool = True ,
106109 device : torch .device | None = None ,
107110 vocab_size : int | None = None ,
108111 no_stack : bool = True ,
@@ -250,7 +253,7 @@ def from_dataloader(
250253 attention_key : NestedKey | None = None ,
251254 action_key : NestedKey | None = None ,
252255 reward_key : NestedKey = "reward" ,
253- str2str : bool = False ,
256+ str2str : bool = True ,
254257 device : torch .device | None = None ,
255258 vocab_size : int | None = None ,
256259 no_stack : bool = False ,
@@ -267,7 +270,7 @@ def from_dataloader(
267270 stack_method : Callable [[Any ], Any ]
268271 | Literal ["as_nested_tensor" , "as_padded_tensor" ] = None ,
269272 repeats : int | None = None ,
270- group_repeats : bool = False ,
273+ group_repeats : bool = True ,
271274 ) -> LLMEnv :
272275 """Creates an LLMEnv instance from a dataloader.
273276
@@ -297,7 +300,7 @@ def from_dataloader(
297300 ``("tokens_out", "sequences")``.
298301 reward_key (NestedKey, optional): The key in the tensordict where the reward is stored if `assign_reward=True`.
299302 Defaults to ``"reward"``.
300- str2str (bool, optional): Whether the environment should expect strings as input and output. Defaults to ``False ``.
303+ str2str (bool, optional): Whether the environment should expect strings as input and output. Defaults to ``True ``.
301304 device (torch.device | None, optional): The device on which the environment should run. Defaults to ``None``.
302305 vocab_size (int | None, optional): The size of the vocabulary. If None, the environment will assume an
303306 unbounded vocabulary. Defaults to ``None``.
@@ -334,7 +337,7 @@ def from_dataloader(
334337 situations like GRPO where a single prompt is used multiple times to estimate the advantage using Monte-Carlo
335338 samples (rather than an advantage module).
336339 group_repeats (bool, optional): if ``True``, the batch-size is multiplied by the number of repeats such that
337- all repeats are grouped in a single batch collected from the buffer. Defaults to ``False ``.
340+ all repeats are grouped in a single batch collected from the buffer. Defaults to ``True ``.
338341
339342 Returns:
340343 LLMEnv: The created LLMEnv instance.
0 commit comments