Mozilla-Ocho / llamafile

Distribute and run LLMs with a single file.
https://llamafile.ai
Other
19.39k stars 982 forks source link

Bug: whisperfile --help doesn't mention --no-prints #544

Closed simonw closed 1 month ago

simonw commented 1 month ago

Contact Details

No response

What happened?

I ran ./whisperfile-0.8.13 --help and it didn't tell me about the --no-prints option, which is the option I was looking for.

Version

whisperfile v0.8.13

What operating system are you seeing the problem on?

Mac

Relevant log output

No response

simonw commented 1 month ago

Current --help output for me looks like this:

WHISPERFILE(1)              General Commands Manual             WHISPERFILE(1)

NAME
       whisperfile — speech to text engine

SYNOPSIS
       whisperfile [flags...] -m model.gguf -f audio.wav
       whisperfile [flags...] --server -m model.gguf

DESCRIPTION
       whisperfile  is  a  high-performance implementation of OpenAI's Whisper
       model that's based off  the  whisper.cpp  software  written  by  Georgi
       Gerganov,  et  al.   It's  able  to convert speech to text. It can also
       translate different languages into English while transcribing.

OPTIONS
       The following options are available:

       --version
               Print version and exit.

       -h, --help
               Show help message and exit.

       --server
               Puts program in HTTP server mode.

       -m FNAME, --model FNAME
               Path   of   Whisper   model   weights.   See   https://hugging‐
               face.co/ggerganov/whisper.cpp

       -f FNAME, --file FNAME
               Path of WAV file to transcribe.

       -tr, --translate
               Translate audio into English text.

       -ot N, --offset-t N
               Time offset in milliseconds.

       -d N, --duration N
               Duration of audio to process in milliseconds.

       -pc, --print-colors
               Enables CLI printing of ANSI color codes.

               Transcribed  text  will appear in the terminal on a spectrum of
               color ranging from green to red. Green means the model

       -t N, --threads N
               Overrides number of threads to use.

               The default is the number of cores  available  on  the  current
               system.  On systems with hyperthreading, that's half the number
               of CPUs reported by the system. On systems that have efficiency
               cores, e.g. Intel Alderlake, the default  behavior  is  to  use
               only the performance cores.

DOCUMENTATION
       Read  our Markdown documentation for additional help and tutorials. See
       whisper.cpp/doc/index.md in the llamafile source repository on GitHub.

SEE ALSO
       llamafile(1), zipalign(1), unzip(1)

Mozilla Ocho                    August 17, 2024                 WHISPERFILE(1)
simonw commented 1 month ago

Are there any other undocumented options? I was hoping there would be an option to set a custom Whisper prompt in order to teach it extra vocabulary.

jart commented 1 month ago

I agree. The --no-prints flag definitely deserves a mention in the man page. I've just pushed a change adding that.

I've been documenting whisperfile gradually as I've been learning it myself and carefully studying the upstream codebase this project inherited. That's going to be a gradual process you can expect to see improve over time and I appreciate your feedback in that process. Other flags, e.g. -p I've intentionally avoided mentioning, because I view them as potentially harmful.

Most of the undocumented flags are here:

https://github.com/Mozilla-Ocho/llamafile/blob/c8b483f9912435967bb96dc643fb36f5a14d4456/whisper.cpp/main.cpp#L233-L283

whisperfile also supports various flags which are inherited from llamafile, e.g.

jart commented 1 month ago

Oh and there's another set of flags documented here. I'm still in the process of de-duplicating some of this code.

https://github.com/Mozilla-Ocho/llamafile/blob/c8b483f9912435967bb96dc643fb36f5a14d4456/whisper.cpp/server.cpp#L105-L144

sholtomaud commented 1 month ago

@simonw did you find out if any of the undocumented options given by Justine above set a custom Whisper prompt in order to teach it extra vocabulary?