Update ultravox_pipeline.py
Browse files- ultravox_pipeline.py +8 -3
ultravox_pipeline.py
CHANGED
@@ -18,9 +18,14 @@ class UltravoxPipeline(transformers.Pipeline):
|
|
18 |
**kwargs
|
19 |
):
|
20 |
if tokenizer is None:
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
if audio_processor is None:
|
26 |
audio_processor = transformers.AutoProcessor.from_pretrained(
|
|
|
18 |
**kwargs
|
19 |
):
|
20 |
if tokenizer is None:
|
21 |
+
try:
|
22 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
23 |
+
model.config._name_or_path
|
24 |
+
)
|
25 |
+
except:
|
26 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
27 |
+
model.config.text_model_id or model.config.text_config._name_or_path
|
28 |
+
)
|
29 |
|
30 |
if audio_processor is None:
|
31 |
audio_processor = transformers.AutoProcessor.from_pretrained(
|