Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify vosk-cli model search behaviour #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ If you want or need to install from source, visit

Go to [https://alphacephei.com/vosk/models](https://alphacephei.com/vosk/models) and download at least the English language model. The larger models generally yield better results.

You can unzip the folder of the language model into any directory, but it is recommended to create and use a `./models` folder in the project directory.

## Usage

Now you are able to run `vosk-cli -i <input_file_path> -o <output_file_path> -m <model_name_or_path>`.
Expand All @@ -45,3 +43,13 @@ For example, if there is a `video.mp4` file in your download folder and a model
`vosk-cli -i ~/Downloads/video.mp4 -o text -m vosk-model-en-us-0.22`

This will create a `text.vtt` file (which contains the transcribed captions) in your current directory.

### Model Search Paths

Vosk-cli follows the following algorithm when attempting to find matching models:

- Check if the `-m` flag is passed as an absolute path, if so use it verbatim.
- Check if `./models/$model` is a directory, if so use it.
- Check if `/usr/share/vosk/models/$model` is a directory, if so use it.

**NOTE:** Vosk-cli requires an exact match between directory and model name. If you pass `-m eng` you must have an `eng` model in your model search path!