Skip to content

Commit 5d051bd

Browse files
committed
fix debug samples
1 parent e7d1bfc commit 5d051bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/forge/data/rewards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class LanguageReward:
112112
match_reward: Reward when detected language matches target (default: 1.0)
113113
no_match_reward: Reward when language doesn't match (default: 0.0)
114114
tag: Tag name to use (default "思考" for multilingual, can use "think", etc.)
115-
debug: If True, print debug samples showing model outputs and detected language for every sample
115+
debug: If True, print debug samples showing model outputs and detected language
116116
debug_sample_rate: Fraction of calls to debug (e.g., 0.1 = 10% of calls)
117117
118118
Note: Requires langid to be installed. Install with: pip install langid
@@ -167,7 +167,7 @@ def __call__(self, prompt: str, response: str, target: str | None = None) -> flo
167167
"""
168168

169169
# TODO: refactor pending https://github.com/meta-pytorch/torchforge/issues/187
170-
should_debug = self.debug or (random.random() < self.debug_sample_rate)
170+
should_debug = self.debug and (random.random() < self.debug_sample_rate)
171171

172172
if not response:
173173
if should_debug:

0 commit comments

Comments
 (0)