buzz icon indicating copy to clipboard operation
buzz copied to clipboard

If GPU operations can be implemented, the extraction speed should be much faster

Open martjay opened this issue 2 years ago • 15 comments

If GPU operations can be implemented, the extraction speed should be much faster, The CPU mode is still too slow.

martjay avatar Jan 04 '23 02:01 martjay

https://github.com/openai/whisper/discussions/47

martjay avatar Jan 04 '23 02:01 martjay

https://s3.bmp.ovh/imgs/2023/01/04/936aad75fd9795aa.jpg

I can't find .srt file

martjay avatar Jan 04 '23 03:01 martjay

Sure, I haven't figured out the GPU yet. But I'll mark this as a duplicate of #182 for now.

chidiwilliams avatar Jan 04 '23 09:01 chidiwilliams

https://s3.bmp.ovh/imgs/2023/01/04/936aad75fd9795aa.jpg

I can't find .srt file

I don't have access to the image. Maybe a permissions issue?

chidiwilliams avatar Jan 04 '23 09:01 chidiwilliams

https://s3.bmp.ovh/imgs/2023/01/04/936aad75fd9795aa.jpg I can't find .srt file

I don't have access to the image. Maybe a permissions issue?

777777

martjay avatar Jan 04 '23 14:01 martjay

u can try select this line and click third ico

xxx975 avatar Jan 05 '23 07:01 xxx975

this line == 3 Levels of Chords - ........
:)

xxx975 avatar Jan 05 '23 07:01 xxx975

this line == 3 Levels of Chords - ........ :)

Thank you. In this way, the subtitles can be exported. I think the subtitles will be automatically exported to the video directory

martjay avatar Jan 05 '23 08:01 martjay

Followed the steps from here https://github.com/openai/whisper/discussions/47

For me now: "CUDA enabled: True"

But the Buzz still runs on the CPU. While they say, Whisper should detect CUDA and run on GPU.

esonec avatar Jan 05 '23 18:01 esonec

this line == 3 Levels of Chords - ........ :)

Thank you. In this way, the subtitles can be exported. I think the subtitles will be automatically exported to the video directory

Yes, the behaviour changed in the last release. Double-clicking the line also works :)

chidiwilliams avatar Jan 05 '23 19:01 chidiwilliams

Followed the steps from here openai/whisper#47

For me now: "CUDA enabled: True"

But the Buzz still runs on the CPU. While they say, Whisper should detect CUDA and run on GPU.

Using GPU mode will be much faster than using CPU. I really don't cheat you

martjay avatar Jan 06 '23 05:01 martjay

this line == 3 Levels of Chords - ........ :)

Thank you. In this way, the subtitles can be exported. I think the subtitles will be automatically exported to the video directory

Yes, the behaviour changed in the last release. Double-clicking the line also works :)

Can't the latest version automatically generate the srt to the video directory? I think automatic generation is more convenient

martjay avatar Jan 06 '23 05:01 martjay

Currently, pytorch with CUDA support is only available if you manually install pytorch build supporting CUDA inside poetry virtualenv. You also need to uninstall previous build with pip.

https://github.com/openai/whisper/discussions/47#discussioncomment-4549820

Follow the steps above, then apply the following patch.

diff --git a/buzz/transcriber.py b/buzz/transcriber.py
index c087c13..c489d9a 100644
--- a/buzz/transcriber.py
+++ b/buzz/transcriber.py
@@ -424,7 +424,8 @@ def transcribe_whisper(stderr_conn: Connection, task: FileTranscriptionTask):
                                       task=task.transcription_options.task.value, verbose=False)
             whisper_segments = result.get('segments')
         else:
-            model = whisper.load_model(task.model_path)
+            logging.info("Loading whisper with CUDA device")
+            model = whisper.load_model(task.model_path, device="cuda")
             if task.transcription_options.word_level_timings:
                 stable_whisper.modify_model(model)
                 result = model.transcribe(

ttimasdf avatar Jan 07 '23 05:01 ttimasdf

Changes I made to install pytorch through poetry. Tested on windows.

diff --git a/pyproject.toml b/pyproject.toml
index 2ffef1f..12a60ea 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,13 +10,15 @@ readme = "README.md"
 python = ">=3.9.13,<3.11"
@@ -10,13 +10,15 @@ readme = "README.md"
 python = ">=3.9.13,<3.11"
 sounddevice = "^0.4.5"
 whisper = { git = "https://github.com/openai/whisper.git" }
-torch = "1.12.1"
+torch = {version = "^1.13.1+cu117", source = "pytorch-cu117"}
 transformers = "~4.24.0"
 appdirs = "^1.4.4"
 ffmpeg-python = "^0.2.0"
 humanize = "^4.4.0"
 PyQt6 = "^6.4.0"
+stable-ts = "^1.0.2"
 tqdm = "^4.64.1"
+click = "^8.1.3"

 [tool.poetry.group.dev.dependencies]
 autopep8 = "^1.7.0"
@@ -30,6 +32,13 @@ pylint = "^2.15.5"
 pre-commit = "^2.20.0"
 ctypesgen = "^1.1.1"

+
+[[tool.poetry.source]]
+name = "pytorch-cu117"
+url = "https://download.pytorch.org/whl/cu117"
+default = false
+secondary = true
+
 [build-system]
 requires = ["poetry-core"]
 build-backend = "poetry.core.masonry.api"

ttimasdf avatar Jan 08 '23 15:01 ttimasdf

Changes I made to install pytorch through poetry. Tested on windows.

diff --git a/pyproject.toml b/pyproject.toml
index 2ffef1f..12a60ea 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,13 +10,15 @@ readme = "README.md"
 python = ">=3.9.13,<3.11"
@@ -10,13 +10,15 @@ readme = "README.md"
 python = ">=3.9.13,<3.11"
 sounddevice = "^0.4.5"
 whisper = { git = "https://github.com/openai/whisper.git" }
-torch = "1.12.1"
+torch = {version = "^1.13.1+cu117", source = "pytorch-cu117"}
 transformers = "~4.24.0"
 appdirs = "^1.4.4"
 ffmpeg-python = "^0.2.0"
 humanize = "^4.4.0"
 PyQt6 = "^6.4.0"
+stable-ts = "^1.0.2"
 tqdm = "^4.64.1"
+click = "^8.1.3"

 [tool.poetry.group.dev.dependencies]
 autopep8 = "^1.7.0"
@@ -30,6 +32,13 @@ pylint = "^2.15.5"
 pre-commit = "^2.20.0"
 ctypesgen = "^1.1.1"

+
+[[tool.poetry.source]]
+name = "pytorch-cu117"
+url = "https://download.pytorch.org/whl/cu117"
+default = false
+secondary = true
+
 [build-system]
 requires = ["poetry-core"]
 build-backend = "poetry.core.masonry.api"

@chidiwilliams see, but I dont know how to do, pls update new version release~

martjay avatar Jan 09 '23 06:01 martjay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 01 '23 09:04 stale[bot]