Tweak whisper core/thread count
This commit is contained in:
		
							parent
							
								
									6df4a1e506
								
							
						
					
					
						commit
						589abb9e46
					
				|  | @ -71,16 +71,24 @@ fi | ||||||
| 
 | 
 | ||||||
| output_name="$output_name_without_ext.${model}" | output_name="$output_name_without_ext.${model}" | ||||||
| 
 | 
 | ||||||
| printf "\n${YELLOW}${BOLD}Transcribing $input_wav | model: $model | threads: $threads | output: $output_name ${NORMAL}\n" | 
 | ||||||
|  | # 1 core 31 threads has very fast pcm_to_mel conversion and then just one core doing most of the work. You get more accurate results this way. | ||||||
|  | # 2 core 16 is about half the time but it can have errors where the two pieces come together. This only gets more likely as the core count is increased. | ||||||
|  | # 8 threads, 4 cores is good too for tiny,small and 2 threads, 4 cores for medium. | ||||||
|  | 
 | ||||||
|  | threads=31 #keep a thread for me | ||||||
|  | cores=1 | ||||||
|  | 
 | ||||||
|  | printf "\n${YELLOW}${BOLD}Transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name ${NORMAL}\n" | ||||||
| 
 | 
 | ||||||
| whisper_fullname="$(expand_path $(which whisper.exe))" | whisper_fullname="$(expand_path $(which whisper.exe))" | ||||||
| whisper_path="$(dirname $whisper_fullname)" | whisper_path="$(dirname $whisper_fullname)" | ||||||
| models_path="$whisper_path/models" | models_path="$whisper_path/models" | ||||||
| 
 | 
 | ||||||
| whisper.exe --threads ${threads} -m "$models_path/ggml-${model}.en.bin" -otxt -osrt -f "$input_wav" -of "$output_name" --print-colors | whisper.exe --processors ${cores} --threads ${threads} -m "$models_path/ggml-${model}.en.bin" -otxt -osrt -f "$input_wav" -of "$output_name" --print-colors --print-progress | ||||||
| error=$? | error=$? | ||||||
| if [[ error -eq 0 ]]; then | if [[ error -eq 0 ]]; then | ||||||
|     printf "${GREEN}${BOLD}Done transcribing $input_wav | model: $model | threads: $threads | output: $output_name${NORMAL}\n" |     printf "${GREEN}${BOLD}Done transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n" | ||||||
| else | else | ||||||
|     printf "${GREEN}${BOLD}Error while transcribing $input_wav | model: $model | threads: $threads | output: $output_name${NORMAL}\n" |     printf "${GREEN}${BOLD}Error while transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ shift 2 | ||||||
| models=("$@") | models=("$@") | ||||||
| 
 | 
 | ||||||
| if [[ $input_video == "" || $output_name_without_ext == "" || ${#models[@]} -eq 0 ]]; then | if [[ $input_video == "" || $output_name_without_ext == "" || ${#models[@]} -eq 0 ]]; then | ||||||
|     printf "${BOLD}${RED}Usage: $0 <input.wav> <output name without extension> <list of model names to use>${NORMAL}\n" |     printf "${BOLD}${RED}Usage: $0 <input.mp4> <output name without extension> <list of model names to use>${NORMAL}\n" | ||||||
|     exit 1 |     exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user