From 63ec189e36683518a5fdff33744b639fccb07c96 Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Wed, 27 Nov 2024 09:10:50 -0800 Subject: [PATCH] Fix processor being overwritten by parent class --- ultravox/model/ultravox_pipeline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ultravox/model/ultravox_pipeline.py b/ultravox/model/ultravox_pipeline.py index c9a8aaa1..55e8ff7f 100644 --- a/ultravox/model/ultravox_pipeline.py +++ b/ultravox/model/ultravox_pipeline.py @@ -32,15 +32,15 @@ def __init__( audio_processor = transformers.AutoProcessor.from_pretrained( model.config.audio_model_id or model.config.audio_config._name_or_path ) - + + super().__init__(model=model, tokenizer=tokenizer, **kwargs) + self.processor = UltravoxProcessor( audio_processor=audio_processor, tokenizer=tokenizer, stack_factor=model.config.stack_factor, ) - super().__init__(model=model, tokenizer=tokenizer, **kwargs) - def _sanitize_parameters(self, **kwargs): generation_keys = ["temperature", "max_new_tokens", "repetition_penalty"] generation_kwargs = {k: kwargs[k] for k in kwargs if k in generation_keys}