Compare commits

..

No commits in common. "a529cd656074b93172acbc661e68405b5c5d6ee7" and "6df4a1e5069b092c53d3d5278fcf3122c3b310eb" have entirely different histories.

3 changed files with 19 additions and 50 deletions

View File

@ -71,24 +71,16 @@ 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 --processors ${cores} --threads ${threads} -m "$models_path/ggml-${model}.en.bin" -otxt -osrt -f "$input_wav" -of "$output_name" --print-colors --print-progress whisper.exe --threads ${threads} -m "$models_path/ggml-${model}.en.bin" -otxt -osrt -f "$input_wav" -of "$output_name" --print-colors
error=$? error=$?
if [[ error -eq 0 ]]; then if [[ error -eq 0 ]]; then
printf "${GREEN}${BOLD}Done transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n" printf "${GREEN}${BOLD}Done transcribing $input_wav | model: $model | threads: $threads | output: $output_name${NORMAL}\n"
else else
printf "${GREEN}${BOLD}Error while transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n" printf "${GREEN}${BOLD}Error while transcribing $input_wav | model: $model | threads: $threads | output: $output_name${NORMAL}\n"
fi fi

View File

@ -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.mp4> <output name without extension> <list of model names to use>${NORMAL}\n" printf "${BOLD}${RED}Usage: $0 <input.wav> <output name without extension> <list of model names to use>${NORMAL}\n"
exit 1 exit 1
fi fi

51
vimrc
View File

@ -570,7 +570,7 @@ augroup END
" Suspend vim process and return to the shell. Can return to vim with `fg`. " Suspend vim process and return to the shell. Can return to vim with `fg`.
nnoremap <leader>z <c-z> nnoremap <leader>z <c-z>
" Edit a file " edit a file
nnoremap <leader>e :e nnoremap <leader>e :e
" Open the vimrc file for editing / reload vimrc file. " Open the vimrc file for editing / reload vimrc file.
@ -614,22 +614,8 @@ noremap <c-h> <c-w><Left>
noremap <leader>m :vsplit<cr> noremap <leader>m :vsplit<cr>
noremap <leader>mm :split<cr> noremap <leader>mm :split<cr>
" Faster way to activate the 'a' register. This is useful for putting different " Forward delete and replace a word.
" lines of text into the 'a' register and then pasting it as a group. noremap <leader>d ciw
" You need to first use `<leader>a` and then subsequent use is <leader>A.
" The paste command will use this content until you do something with a
" different register. You can later paste the 'a' contents using `<leader>a p`
" This overwrites the contents of a.
noremap <leader>a "a
" This appends to a.
noremap <leader>aa "A
" Backward replace word including cursor character.
noremap <leader>d cvb
" Forward replace word.
noremap <leader>e cw
" Allow fast pasting by accessing the system clipboard register. " Allow fast pasting by accessing the system clipboard register.
noremap <leader>p "+p noremap <leader>p "+p
@ -742,35 +728,26 @@ function! WriteAllModifiedFilesAndCreateCtags()
call CreateCtags() call CreateCtags()
endfunction endfunction
" Create a command abbreviation that only applies when it's at the beginning cnoreabbrev w :call WriteCurrentFileAndCreateCtags()
" of a ex command. If you were to do a normal cnoreabbrev or cabbrev then the cnoreabbrev W :call WriteCurrentFileAndCreateCtags()
" subsitution can happen anywhere in the command line. It was mostly affecting cnoreabbrev wa :call WriteAllModifiedFilesAndCreateCtags()
" my text search; I'd type '/w' and it would be replaced with the call to save cnoreabbrev Wa :call WriteAllModifiedFilesAndCreateCtags()
" and create ctags. cnoreabbrev WA :call WriteAllModifiedFilesAndCreateCtags()
function! Cabbrev(key, value) cnoreabbrev wq :call WriteCurrentFileAndCreateCtagsThenQuit()
exe printf('cabbrev <expr> %s (getcmdtype() == ":" && getcmdpos() <= %d) ? %s : %s', cnoreabbrev Wq :call WriteCurrentFileAndCreateCtagsThenQuit()
\ a:key, len(a:key)+1, string(a:value), string(a:key)) cnoreabbrev WQ :call WriteCurrentFileAndCreateCtagsThenQuit()
endfunction
call Cabbrev('w', 'call WriteCurrentFileAndCreateCtags()')
call Cabbrev('W', 'call WriteCurrentFileAndCreateCtags()')
call Cabbrev('wa', 'call WriteAllModifiedFilesAndCreateCtags()')
call Cabbrev('Wa', 'call WriteAllModifiedFilesAndCreateCtags()')
call Cabbrev('WA', 'call WriteAllModifiedFilesAndCreateCtags()')
call Cabbrev('wq', 'call WriteCurrentFileAndCreateCtagsThenQuit()')
call Cabbrev('Wq', 'call WriteCurrentFileAndCreateCtagsThenQuit()')
call Cabbrev('WQ', 'call WriteCurrentFileAndCreateCtagsThenQuit()')
nnoremap <leader>w :call WriteCurrentFileAndCreateCtags()<cr> nnoremap <leader>w :call WriteCurrentFileAndCreateCtags()<cr>
nnoremap <leader>x :call WriteCurrentFileAndCreateCtagsThenQuit()<cr> nnoremap <leader>x :call WriteCurrentFileAndCreateCtagsThenQuit()<cr>
nnoremap <leader>q :q<cr> nnoremap <leader>q :q<cr>
call Cabbrev('Q', 'q') cnoreabbrev Q q
call Cabbrev('Qa', 'qa') cnoreabbrev Qa qa
command! Qa qall command! Qa qall
" Disable Ex mode. " Disable Ex mode.
noremap Q <Nop> noremap Q <Nop>
"################################################################################## "##################################################################################
" MULTIPURPOSE TAB KEY " MULTIPURPOSE TAB KEY
"################################################################################## "##################################################################################