Repository navigation
Commit 7ecf8b5
authored
fix: define LAMBDA_ARN_REGEX in finetune_utils to fix RLVRTrainer NameError (#5988)
`_is_lambda_arn()` in finetune_utils.py referenced `LAMBDA_ARN_REGEX`,
but the constant was never defined or imported in the module. Any RLVR
training submitted with an evaluator (hub-content) ARN reward function
hit the `not _is_lambda_arn(...)` branch in
`RLVRTrainer._verify_reward_function` and crashed with:
NameError: name 'LAMBDA_ARN_REGEX' is not defined
The identical regex already exists in rlvr_reward_verifier.py, and both
call sites answer the same question ("is this a Lambda ARN?"). Import the
canonical pattern rather than duplicating it so the two paths cannot drift.
Adds regression tests covering valid Lambda ARNs (incl. non-aws
partitions), evaluator hub-content ARNs, and that both modules share the
same compiled regex.
Fixes: P4675407381 parent 3ab2524 commit 7ecf8b5
2 files changed
Lines changed: 34 additions & 0 deletions
File tree
- sagemaker-train
- src/sagemaker/train/common_utils
- tests/unit/train/common_utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
1332 | 1333 | | |
1333 | 1334 | | |
1334 | 1335 | | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
0 commit comments