[Chore] Remove vendored code made redundant by Transformers 5.16.1 (#60623)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bc713cf8cc
commit
2c99ee9333
@@ -158,9 +158,7 @@ class GraniteSpeechMultiModalProcessor(
|
||||
feature_extractor = processor.audio_processor
|
||||
vocab = tokenizer.get_vocab()
|
||||
|
||||
# Use getattr with default to be compatible with transformers<4.48
|
||||
audio_token = getattr(processor, "audio_token", "<|audio|>")
|
||||
audio_token_id = vocab[audio_token]
|
||||
audio_token_id = vocab[processor.audio_token]
|
||||
|
||||
def get_replacement(item_idx: int):
|
||||
audios = mm_items.get_items("audio", AudioProcessorItems)
|
||||
@@ -221,8 +219,7 @@ class GraniteSpeechDummyInputsBuilder(
|
||||
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
||||
num_audios = mm_counts.get("audio", 0)
|
||||
hf_processor = self.info.get_hf_processor()
|
||||
audio_token = getattr(hf_processor, "audio_token", "<|audio|>")
|
||||
return audio_token * num_audios
|
||||
return hf_processor.audio_token * num_audios
|
||||
|
||||
|
||||
### QFormer Projector
|
||||
|
||||
Reference in New Issue
Block a user