farzadab commited on
Commit
2eebed8
1 Parent(s): d5b56e4

Upload UltravoxPipeline

Browse files
config.json CHANGED
@@ -154,16 +154,10 @@
154
  },
155
  "custom_pipelines": {
156
  "ultravox-pipeline": {
157
- "default": {
158
- "model": {
159
- "pt": [
160
- "fixie-ai/ultravox-v0.2",
161
- "main"
162
- ]
163
- }
164
- },
165
  "impl": "ultravox_pipeline.UltravoxPipeline",
166
- "pt": ["AutoModel"],
 
 
167
  "tf": [],
168
  "type": "multimodal"
169
  }
@@ -193,6 +187,6 @@
193
  },
194
  "text_model_id": null,
195
  "torch_dtype": "bfloat16",
196
- "transformers_version": "4.41.2",
197
  "vocab_size": 128256
198
  }
 
154
  },
155
  "custom_pipelines": {
156
  "ultravox-pipeline": {
 
 
 
 
 
 
 
 
157
  "impl": "ultravox_pipeline.UltravoxPipeline",
158
+ "pt": [
159
+ "AutoModel"
160
+ ],
161
  "tf": [],
162
  "type": "multimodal"
163
  }
 
187
  },
188
  "text_model_id": null,
189
  "torch_dtype": "bfloat16",
190
+ "transformers_version": "4.41.1",
191
  "vocab_size": 128256
192
  }
generation_config.json CHANGED
@@ -2,5 +2,6 @@
2
  "_from_model_config": true,
3
  "bos_token_id": 128000,
4
  "eos_token_id": 128009,
5
- "transformers_version": "4.41.2"
 
6
  }
 
2
  "_from_model_config": true,
3
  "bos_token_id": 128000,
4
  "eos_token_id": 128009,
5
+ "pad_token_id": 128009,
6
+ "transformers_version": "4.41.1"
7
  }
special_tokens_map.json CHANGED
@@ -13,5 +13,11 @@
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
- "pad_token": "<|eot_id|>"
 
 
 
 
 
 
17
  }
 
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
+ "pad_token": {
17
+ "content": "<|eot_id|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
  }
ultravox_pipeline.py CHANGED
@@ -67,11 +67,15 @@ class UltravoxPipeline(transformers.Pipeline):
67
  "No sampling rate provided, using default of 16kHz. We highly recommend providing the correct sampling rate."
68
  )
69
 
70
- return self.processor(
71
  text=text,
72
  audio=inputs["audio"],
73
  sampling_rate=inputs.get("sampling_rate", 16000),
74
  )
 
 
 
 
75
 
76
  def _forward(
77
  self,
 
67
  "No sampling rate provided, using default of 16kHz. We highly recommend providing the correct sampling rate."
68
  )
69
 
70
+ output = self.processor(
71
  text=text,
72
  audio=inputs["audio"],
73
  sampling_rate=inputs.get("sampling_rate", 16000),
74
  )
75
+ if "audio_values" in output:
76
+ output["audio_values"] = output["audio_values"].to(self.model.dtype)
77
+
78
+ return output
79
 
80
  def _forward(
81
  self,