Skip to content

Commit

Permalink
Merge pull request #76 from opentensor/mock-blacklist-fix
Browse files Browse the repository at this point in the history
ensure mock reward model has new blacklist functions or crashes
  • Loading branch information
p-ferreira authored Nov 20, 2023
2 parents f104e25 + 4eb41fa commit 7709305
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prompting/validators/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def __init__(self, mock_name: str = "MockReward"):
self.question_blacklist = []
self.answer_blacklist = []

def add(self, texts: List[str]):
pass

def set_counter_to_half(self):
pass

def apply(self, prompt: str, completion: List[str], name: str) -> torch.FloatTensor:
mock_reward = torch.tensor([1 for _ in completion], dtype=torch.float32)
return mock_reward, {}
Expand Down

0 comments on commit 7709305

Please sign in to comment.