Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rl4lms/envs/text_generation/policy/causal_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def _prepare_inputs_for_model(
input_ids, **model_kwargs
)

""" Make sure to use the configuration in the configuration file"""
if model_inputs.get("use_cache", None) is None:
model_inputs['use_cache'] = self._generation_kwargs.get("use_cache", None)

if self._apply_model_parallel and unwrap_model(model).is_parallelizable:
# if model is in parallel mode, move the tensors to the first device
model_inputs = {
Expand Down