Skip to content

Commit 1a6d0ca

Browse files
committed
Merge remote-tracking branch 'origin/dev' into kernels_unittest_fix_ljl
2 parents 1d8094d + 3f8f6b0 commit 1a6d0ca

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

cookbook/client/tinker/short_math_grpo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __call__(self, sample):
7474
return Trajectory(messages=[], user_data=[])
7575

7676
def get_boxed_answer(text):
77-
match = re.search(r'\\boxed\{([^}]+)\}', text)
77+
match = re.search(r'\\boxed{([^}]*)}', text)
7878
return match.group(1) if match else None
7979

8080
ground_truth = get_boxed_answer(sample['solution'])

src/twinkle/metric/completion_and_reward.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ def reset(self):
2020
self.rewards = {}
2121
self.completion_lengths = []
2222

23-
def accumulate(self,
24-
inputs=None, # ignore
25-
outputs=None,# ignore
26-
*,
27-
rewards=None,
28-
completion_lengths=None,
29-
generate_time: float = None,
30-
weight_sync_time: float = None,
31-
**kwargs):
23+
def accumulate(
24+
self,
25+
inputs=None, # ignore
26+
outputs=None, # ignore
27+
*,
28+
rewards=None,
29+
completion_lengths=None,
30+
generate_time: float = None,
31+
weight_sync_time: float = None,
32+
**kwargs):
3233
if completion_lengths is None:
3334
completion_lengths = []
3435
if rewards is None:

src/twinkle/sampler/vllm_sampler/vllm_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ async def _get_or_load_lora(
410410
await self.engine.add_lora(lora_request)
411411
self._lora_request_cache[lora_path] = lora_request
412412
return lora_request
413-
except Exception as e:
413+
except Exception: # noqa
414414
return None
415415

416416
async def sleep(self, level: int = 2) -> None:

0 commit comments

Comments
 (0)