Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Audio] Qwen Audio Example #1082

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mask decoder_input_ids
Signed-off-by: Kyle Sayers <[email protected]>
kylesayrs committed Jan 20, 2025
commit 74283e8ea4ac94373854fa8e7bb670970833627f
10 changes: 8 additions & 2 deletions src/llmcompressor/modifiers/utils/pytorch_helpers.py
Original file line number Diff line number Diff line change
@@ -41,8 +41,14 @@ def apply_pad_mask_to_batch(batch: Dict[str, torch.Tensor]) -> Dict[str, torch.T
:param batch: batch to apply padding to if it exists
:return: batch with padding zeroed out in the input_ids
"""
if "input_ids" in batch and "attention_mask" in batch:
batch["input_ids"] = batch["input_ids"] * batch["attention_mask"]
if "attention_mask" in batch:
if "input_ids" in batch:
batch["input_ids"] = batch["input_ids"] * batch["attention_mask"]
if "decoder_input_ids" in batch:
batch["decoder_input_ids"] = (
batch["decoder_input_ids"] * batch["attention_mask"]
)

return batch