Skip to content

fix(examples): add missing json/re imports in DPO notebook pretty_print#6058

Open
Hannah14295 wants to merge 1 commit into
aws:masterfrom
Hannah14295:fix/dpo-trainer-missing-json-re-imports
Open

fix(examples): add missing json/re imports in DPO notebook pretty_print#6058
Hannah14295 wants to merge 1 commit into
aws:masterfrom
Hannah14295:fix/dpo-trainer-missing-json-re-imports

Conversation

@Hannah14295

Copy link
Copy Markdown
Contributor

dpo_trainer_example_notebook_v3_prod defines a pretty_print helper that calls json.dumps() and re.findall(), but the cell imports neither json nor re -- they are only imported in a later cell. So the first pretty_print(training_job) call fails with NameError: name 'json' is not defined.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

dpo_trainer_example_notebook_v3_prod defines a pretty_print helper that calls
json.dumps() and re.findall(), but the cell imports neither json nor re -- they
are only imported in a later cell. So the first pretty_print(training_job) call
fails with NameError: name 'json' is not defined.

Import json and re at the top of the helper cell so it runs standalone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant