Fix hf whisper

This commit is contained in:
litagin02
2024-03-14 16:45:31 +09:00
parent a5540bdb2e
commit 8c95f0ff75
2 changed files with 3 additions and 5 deletions

View File

@@ -26,7 +26,9 @@
"source": [ "source": [
"## 0. 環境構築\n", "## 0. 環境構築\n",
"\n", "\n",
"Style-Bert-VITS2の環境をcolab上に構築します。グラボモードが有効になっていることを確認し、以下のセルを順に実行してください。" "Style-Bert-VITS2の環境をcolab上に構築します。グラボモードが有効になっていることを確認し、以下のセルを順に実行してください。\n",
"\n",
"最近のcolabのアップデートにより、エラーダイアログ「WARNING: The following packages were previously imported in this runtime: [pydevd_plugins]」が出るが、「キャンセル」を選択して続行してください。"
] ]
}, },
{ {

View File

@@ -84,10 +84,6 @@ def transcribe_files_with_hf_whisper(
results: list[str] = [] results: list[str] = []
for whisper_result in pipe(dataset): for whisper_result in pipe(dataset):
logger.debug(whisper_result)
for result in enumerate(whisper_result):
logger.debug(result)
logger.debug(f"Transcribed: {result['text']}")
text: str = whisper_result["text"] text: str = whisper_result["text"]
# なぜかテキストの最初に" {initial_prompt}"が入るので、文字の最初からこれを削除する # なぜかテキストの最初に" {initial_prompt}"が入るので、文字の最初からこれを削除する
# cf. https://github.com/huggingface/transformers/issues/27594 # cf. https://github.com/huggingface/transformers/issues/27594