m1guelpf / auto-subtitle

Automatically generate and overlay subtitles for any video.
MIT License
1.49k stars 236 forks source link

Cannot fully utilize all cpu cores #57

Open realzhujunhao opened 1 year ago

realzhujunhao commented 1 year ago

Environment: MacOS, Arm m1, 10 cores, 32GB RAM

auto_subtitle in.mp4 --model medium --task translate -o out/
100%|█████████████████████████████████████| 1.42G/1.42G [02:48<00:00, 9.05MiB/s]
Extracting audio from in...
Generating subtitles for in... This might take a while.
Detected language: Korean
 58%|████████████████████████████████████████████████████▍                                      | 310124/537771 [24:35<20:47, 182.45frames/s]
-> top
PID    COMMAND      %CPU  TIME     #TH    #WQ  #PORT MEM    PURG   CMPRS PGRP
77464  Python       380.9 37:22.99 16/2   5/1  47    3433M  0B     0B    77464

CPU usage bounces on the interval [140%, 380%], resulting in idle cpu resource above 60%

Is there a command line argument for specifying degree of parallelism?

mauropm-clara commented 3 months ago

Some feedback, maybe got fixed by some other changes.

Running the code from Jun 27th, 2024, I have seen this with an m2:

Screenshot 2024-06-27 at 11 36 16 a m

It's still running and it's always 600%+ so far.