Skip to content

Commit

Permalink
Merge pull request #115 from kounoike/improvement/transcribe
Browse files Browse the repository at this point in the history
文字起こし速度の改善
  • Loading branch information
kounoike authored Apr 18, 2023
2 parents c1651e9 + 102a969 commit 4f28658
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker-compose/worker/run_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# or run on CPU with INT8
# model = WhisperModel(model_size, device="cpu", compute_type="int8")

segments, info = model.transcribe(sys.argv[2], beam_size=5, language="ja", initial_prompt=initial_prompt)
segments, info = model.transcribe(sys.argv[2], beam_size=5, language="ja", initial_prompt=initial_prompt, vad_filter=True)

#print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

Expand Down
2 changes: 1 addition & 1 deletion tasks/transcription_local_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (e *ProgramTranscriberLocal) ProcessTask(ctx context.Context, t *asynq.Task
}

tmpFile := fmt.Sprintf("/tmp/%d.wav", p.ProgramId)
commandLine := fmt.Sprintf(`ffmpeg -hide_banner -i "%s" -vn "%s" -y`, inputFile, tmpFile)
commandLine := fmt.Sprintf(`ffmpeg -hide_banner -i "%s" -ac 1 -ar 16000 -vn -sn "%s" -y`, inputFile, tmpFile)

e.logger.Info("Running split audio command", zap.String("command", commandLine))

Expand Down
2 changes: 1 addition & 1 deletion whisper/run_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# or run on CPU with INT8
# model = WhisperModel(model_size, device="cpu", compute_type="int8")

segments, info = model.transcribe(sys.argv[2], beam_size=5, language="ja", initial_prompt=initial_prompt)
segments, info = model.transcribe(sys.argv[2], beam_size=5, language="ja", initial_prompt=initial_prompt, vad_filter=True)

#print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

Expand Down

0 comments on commit 4f28658

Please sign in to comment.