Update ultravox_pipeline.py
Browse files- ultravox_pipeline.py +4 -6
ultravox_pipeline.py
CHANGED
@@ -4,14 +4,14 @@ from typing import Any, Dict, List, Optional
|
|
4 |
import transformers
|
5 |
|
6 |
# We must use relative import in this directory to allow uploading to HF Hub
|
7 |
-
|
8 |
-
|
9 |
|
10 |
|
11 |
class UltravoxPipeline(transformers.Pipeline):
|
12 |
def __init__(
|
13 |
self,
|
14 |
-
model:
|
15 |
tokenizer: Optional[transformers.PreTrainedTokenizerBase] = None,
|
16 |
audio_processor: Optional[transformers.ProcessorMixin] = None,
|
17 |
**kwargs
|
@@ -26,7 +26,7 @@ class UltravoxPipeline(transformers.Pipeline):
|
|
26 |
model.config.audio_model_id
|
27 |
)
|
28 |
|
29 |
-
self.processor =
|
30 |
audio_processor, tokenizer=tokenizer, stack_factor=model.config.stack_factor
|
31 |
)
|
32 |
|
@@ -104,7 +104,5 @@ class UltravoxPipeline(transformers.Pipeline):
|
|
104 |
transformers.pipelines.PIPELINE_REGISTRY.register_pipeline(
|
105 |
"ultravox-pipeline",
|
106 |
pipeline_class=UltravoxPipeline,
|
107 |
-
pt_model=ultravox_model.UltravoxModel,
|
108 |
-
default={"pt": ("fixie-ai/ultravox-v0.2", "main")},
|
109 |
type="multimodal",
|
110 |
)
|
|
|
4 |
import transformers
|
5 |
|
6 |
# We must use relative import in this directory to allow uploading to HF Hub
|
7 |
+
from .ultravox_model import UltravoxModel
|
8 |
+
from .ultravox_processing import UltravoxProcessor
|
9 |
|
10 |
|
11 |
class UltravoxPipeline(transformers.Pipeline):
|
12 |
def __init__(
|
13 |
self,
|
14 |
+
model: UltravoxModel,
|
15 |
tokenizer: Optional[transformers.PreTrainedTokenizerBase] = None,
|
16 |
audio_processor: Optional[transformers.ProcessorMixin] = None,
|
17 |
**kwargs
|
|
|
26 |
model.config.audio_model_id
|
27 |
)
|
28 |
|
29 |
+
self.processor = UltravoxProcessor(
|
30 |
audio_processor, tokenizer=tokenizer, stack_factor=model.config.stack_factor
|
31 |
)
|
32 |
|
|
|
104 |
transformers.pipelines.PIPELINE_REGISTRY.register_pipeline(
|
105 |
"ultravox-pipeline",
|
106 |
pipeline_class=UltravoxPipeline,
|
|
|
|
|
107 |
type="multimodal",
|
108 |
)
|