init
Browse files- pipeline/kotoba_whisper.py +1 -1
- pipeline/push_pipeline.py +8 -1
pipeline/kotoba_whisper.py
CHANGED
|
@@ -216,7 +216,7 @@ class KotobaWhisperPipeline(AutomaticSpeechRecognitionPipeline):
|
|
| 216 |
item["is_last"] = m == len(timelines) - 1 and n == len(labels) - 1 and item["is_last"]
|
| 217 |
yield item
|
| 218 |
else:
|
| 219 |
-
if
|
| 220 |
processed = self.feature_extractor(
|
| 221 |
audio_array,
|
| 222 |
sampling_rate=self.feature_extractor.sampling_rate,
|
|
|
|
| 216 |
item["is_last"] = m == len(timelines) - 1 and n == len(labels) - 1 and item["is_last"]
|
| 217 |
yield item
|
| 218 |
else:
|
| 219 |
+
if audio_array.shape[0] > self.feature_extractor.n_samples:
|
| 220 |
processed = self.feature_extractor(
|
| 221 |
audio_array,
|
| 222 |
sampling_rate=self.feature_extractor.sampling_rate,
|
pipeline/push_pipeline.py
CHANGED
|
@@ -13,7 +13,14 @@ PIPELINE_REGISTRY.register_pipeline(
|
|
| 13 |
pt_model=WhisperForConditionalGeneration,
|
| 14 |
tf_model=TFWhisperForConditionalGeneration
|
| 15 |
)
|
| 16 |
-
pipe = pipeline(task="kotoba-whisper", model="kotoba-tech/kotoba-whisper-v2.0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
pipe.push_to_hub(model_alias)
|
| 18 |
|
| 19 |
|
|
|
|
| 13 |
pt_model=WhisperForConditionalGeneration,
|
| 14 |
tf_model=TFWhisperForConditionalGeneration
|
| 15 |
)
|
| 16 |
+
pipe = pipeline(task="kotoba-whisper", model="kotoba-tech/kotoba-whisper-v2.0", batch_size=16)
|
| 17 |
+
# pprint(pipe("fukabori_trimmed_more_more.mp3"))
|
| 18 |
+
pprint(pipe(
|
| 19 |
+
"fukabori_trimmed_more_more.mp3",
|
| 20 |
+
add_silence_end=0.5,
|
| 21 |
+
add_silence_start=0.5,
|
| 22 |
+
chunk_length_s=15,
|
| 23 |
+
))
|
| 24 |
pipe.push_to_hub(model_alias)
|
| 25 |
|
| 26 |
|