KEMBAR78
Higher-level API for SALM.generate by pzelasko · Pull Request #14034 · NVIDIA-NeMo/NeMo · GitHub
Skip to content

Conversation

@pzelasko
Copy link
Collaborator

@pzelasko pzelasko commented Jun 26, 2025

What does this PR do ?

Enable the following, simpler, usage pattern for inference:

answer = model.generate(
    prompts=[
        [
             {
                  "role": "user", 
                  "content": f"Transcribe the following: {model.audio_locator_tag}", 
                  "audio": [audio_path]
             }
        ],
    ],
    max_new_tokens=64,
)

Collection: speechlm2

Changelog

  • supported audio key in prompts list (can be a string or a list if multiple audio locator tags are used)
  • can specify generation_kwargs to be passed directly to model.llm.generate used under the hood.
  • when generation_config is not specified, we'll auto-create one, pre-populating BOS, EOS, and PAD token ids.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Copy link
Collaborator

@zhehuaichen zhehuaichen left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@github-actions github-actions bot removed the Run CICD label Jun 27, 2025
@chtruong814
Copy link
Collaborator

@pzelasko I think that failing test is unrelated. If you're good with my merging this, I can merge this for you.

@pzelasko
Copy link
Collaborator Author

@pzelasko I think that failing test is unrelated. If you're good with my merging this, I can merge this for you.

@chtruong814 That would be great - thank you!

@chtruong814 chtruong814 merged commit 91d5e0a into main Jul 1, 2025
456 of 460 checks passed
@chtruong814 chtruong814 deleted the salm-generate-simpler-api branch July 1, 2025 19:02
AmirHussein96 pushed a commit to AmirHussein96/NeMo that referenced this pull request Jul 23, 2025
* Higher-level API for SALM.generate

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* fix

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96 pushed a commit to AmirHussein96/NeMo that referenced this pull request Aug 5, 2025
* Higher-level API for SALM.generate

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* fix

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96 pushed a commit to AmirHussein96/NeMo that referenced this pull request Aug 5, 2025
* Higher-level API for SALM.generate

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* fix

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Signed-off-by: Amir Hussein <amhussein@nvidia.com>
nasretdinovr pushed a commit to nasretdinovr/NeMo that referenced this pull request Aug 8, 2025
* Higher-level API for SALM.generate

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

* fix

Signed-off-by: Piotr Żelasko <petezor@gmail.com>

---------

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants