Skip to content

Remove dead misplaced shebang from convert_release_config_to_training.py#97

Open
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:chore/remove-misplaced-shebang
Open

Remove dead misplaced shebang from convert_release_config_to_training.py#97
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:chore/remove-misplaced-shebang

Conversation

@lonexreb
Copy link
Copy Markdown
Contributor

@lonexreb lonexreb commented May 4, 2026

Problem

scripts/convert_release_config_to_training.py has a shebang on line 16, after the SPDX header:

# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
... (12 more license lines) ...
# See the License for the specific language governing permissions and
# limitations under the License.

#!/usr/bin/env python3      <-- line 16, ineffective
r"""Convert nvidia/Alpamayo-R1-10B ...

A shebang only works as the very first line of a file. On line 16 it's just an inert comment the kernel never sees, so even chmod +x + ./script.py would not work as the line implies.

Fix

Two reasonable options existed:

  1. Hoist the shebang to line 1 (and rearrange the SPDX block beneath it).
  2. Delete the shebang.

I chose (2) because:

  • The other three scripts in scripts/ (download_pai.py, curate_pai_samples.py, convert_cosmos_rl_checkpoint.py) have no shebang at all — verified by grep -n '^#!' scripts/*.py.
  • The file is shipped without the executable bit (-rw-r--r--).
  • The script's own usage block invokes it as python scripts/convert_release_config_to_training.py ..., never ./scripts/....

Dropping the line matches the dir convention, removes a misleading marker, and keeps the SPDX header at the canonical position (line 1).

Verification

After this PR, grep -n '^#!' scripts/*.py returns nothing across the entire scripts directory. The script continues to be invoked exactly as documented.

scripts/convert_release_config_to_training.py has a shebang on line 16,
*after* the SPDX header. A shebang only works as the very first line
of a file -- on line 16 it's just an inert comment that the kernel
never sees, so even chmod +x'ing the file would not make `./script.py`
work as advertised.

Two clean fixes existed: hoist the shebang to line 1 (and reorder the
SPDX block beneath it), or delete it. The other three scripts in
scripts/ have no shebang at all, the file is shipped without the
executable bit, and the script's own usage block invokes it via
`python scripts/convert_release_config_to_training.py ...`. Drop the
shebang to match the dir convention and remove the misleading line.

Pure cleanup. No runtime behavior change (the file is still invoked
as a python module, exactly as documented).

Verified: `grep -n '^#!' scripts/*.py` now returns nothing.
Signed-off-by: lonexreb <[email protected]>
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