Skip to content

Fix duplicate script_params in the AzureML BERT notebook - #32532

Open
Yanze (David) Wu (David-Wu1119) wants to merge 1 commit into
microsoft:mainfrom
David-Wu1119:fix/azureml-notebook-duplicate-script-params
Open

Yanze (David) Wu (David-Wu1119) wants to merge 1 commit into
microsoft:mainfrom
David-Wu1119:fix/azureml-notebook-duplicate-script-params

Conversation

@David-Wu1119

Copy link
Copy Markdown

Description

The PyTorch estimator cell in Inference_Bert_with_OnnxRuntime_on_AzureML.ipynb passes script_params twice — the second time as a leftover {...} placeholder:

estimator = PyTorch(source_directory=project_roots,
                    script_params={'--output-dir': './outputs'},
                    compute_target=gpu_compute_target,
                    use_docker=True,
                    custom_docker_image=image_name,
                    script_params = {...},          # <- duplicate
                    entry_script='run_squad_azureml.py',
                    ...)

Python rejects a repeated keyword argument at compile time, so running that cell raises

SyntaxError: keyword argument repeated: script_params

and the notebook cannot proceed past it. Note this is a compile-stage error, so ast.parse() accepts the source and only compile() surfaces it — which is likely why it went unnoticed.

Change

Remove the placeholder line and keep the real value. One line deleted, no other cells or metadata touched.

Verified afterwards by extracting the cell source and calling compile(src, "<cell>", "exec"), which now succeeds.

The PyTorch estimator cell passes script_params twice, the second time
as a `{...}` placeholder:

    script_params={'--output-dir': './outputs'},
    ...
    script_params = {...},

Python rejects a repeated keyword argument at compile time, so the cell
raises

    SyntaxError: keyword argument repeated: script_params

and the notebook cannot be run past that point. Remove the placeholder
and keep the real value.
Copilot AI balanced review requested due to automatic review settings September 10, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

2 participants