farzadab commited on
Commit
06cfca8
1 Parent(s): 7fa1a9b

Update ultravox_pipeline.py

Browse files
Files changed (1) hide show
  1. 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
- tokenizer = transformers.AutoTokenizer.from_pretrained(
22
- model.config.text_config._name_or_path
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(