Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion rl4lms/algorithms/nlpo/nlpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(
use_sde=False,
sde_sample_freq=-1,
tensorboard_log=tensorboard_log,
create_eval_env=create_eval_env,
# create_eval_env=create_eval_env,
policy_kwargs=policy_kwargs,
verbose=verbose,
seed=seed,
Expand Down
13 changes: 7 additions & 6 deletions rl4lms/envs/text_generation/env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from cmath import inf
from typing import Dict, Tuple, Optional, List

import numpy as np
import torch
from gym import Env, spaces
from gym.spaces.dict import Dict as DictSpace
Expand Down Expand Up @@ -57,24 +58,24 @@ def __init__(
# we have to provide fixed sized inputs (padded) because sb3 support for DictObsersevation is limited
# while creating rollout buffers, observations are concatenated for each key
"prompt_or_input_encoded_pt": spaces.Box(
low=0, high=self._vocab_size, shape=(self._max_text_length,)
low=0, high=self._vocab_size, shape=(self._max_text_length,), dtype=np.int64
),
"prompt_or_input_attention_mask_pt": spaces.Box(
low=0, high=1, shape=(self._max_text_length,)
low=0, high=1, shape=(self._max_text_length,), dtype=np.int64
),
"context_encoded_pt": spaces.Box(
low=0, high=self._vocab_size, shape=(self.max_steps,)
low=0, high=self._vocab_size, shape=(self.max_steps,), dtype=np.int64
),
"context_attention_mask_pt": spaces.Box(
low=0, high=1, shape=(self.max_steps,)
low=0, high=1, shape=(self.max_steps,), dtype=np.int64
),
"input_encoded_pt": spaces.Box(
low=0,
high=self._vocab_size,
shape=(self._max_text_length + self.max_steps,),
shape=(self._max_text_length + self.max_steps,), dtype=np.int64
),
"input_attention_mask_pt": spaces.Box(
low=0, high=1, shape=(self._max_text_length + self.max_steps,)
low=0, high=1, shape=(self._max_text_length + self.max_steps,), dtype=np.int64
),
}
)
Expand Down