Skip to content

fix: mark None-default parameters as Optional in vLLMExporter - #724

Open
andrewwhitecdw wants to merge 2 commits into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:andrewwhitecdw/fix/vllm-exporter-optional-hints
Open

fix: mark None-default parameters as Optional in vLLMExporter#724
andrewwhitecdw wants to merge 2 commits into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:andrewwhitecdw/fix/vllm-exporter-optional-hints

Conversation

@andrewwhitecdw

Copy link
Copy Markdown
Contributor

Bug

vLLMExporter.export and vLLMExporter.forward declare several parameters with a default of None but annotate them as non-optional str or int (e.g., tokenizer: str = None). This misrepresents the API and triggers type-checker warnings.

Fix

Annotate all None-default parameters as Optional[...].

Test

Added a static regression test in tests/unit_tests/export/test_vllm_exporter.py that asserts every parameter defaulting to None in these two methods is a typing.Union (i.e., Optional).

Verification

python -m py_compile nemo_export/vllm_exporter.py tests/unit_tests/export/test_vllm_exporter.py passes.

Several arguments in vLLMExporter.export and vLLMExporter.forward use
None as a default but were annotated as non-optional str/int. This
causes type-checker warnings and violates the documented signatures.
Annotate them as Optional.

Adds a static regression test that asserts every parameter with a None
default in these methods is Optional.

Signed-off-by: Andrew White <andrewh@cdw.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@andrewwhitecdw

Copy link
Copy Markdown
Contributor Author

Closing after multiple repair attempts: original patch no longer applies or auditor feedback remains unaddressed.

@andrewwhitecdw
andrewwhitecdw deleted the andrewwhitecdw/fix/vllm-exporter-optional-hints branch August 2, 2026 23:57
@andrewwhitecdw
andrewwhitecdw restored the andrewwhitecdw/fix/vllm-exporter-optional-hints branch August 17, 2026 20:30
@andrewwhitecdw

Copy link
Copy Markdown
Contributor Author

script closed on accident

@oyilmaz-nvidia oyilmaz-nvidia 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.

Thanks! LGTM.

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor

/ok to run 637a7bf

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 637a7bf

@oyilmaz-nvidia
oyilmaz-nvidia enabled auto-merge (squash) August 18, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants