asahi417 commited on
Commit
e34822e
1 Parent(s): 74437d7
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 inputs.shape[0] > self.feature_extractor.n_samples:
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", chunk_length_s=15, batch_size=16)
 
 
 
 
 
 
 
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