Skip to content

Instantly share code, notes, and snippets.

@shoesCodeFor
Created August 1, 2024 16:51
Show Gist options
  • Save shoesCodeFor/762a01b09791fff378d5556dac7f3fa0 to your computer and use it in GitHub Desktop.
Save shoesCodeFor/762a01b09791fff378d5556dac7f3fa0 to your computer and use it in GitHub Desktop.
Nerd Dictation Installer
#!/bin/bash
# Function to handle errors
handle_error() {
echo "An error occurred: $1"
exit 1
}
# Install vosk using pip3
echo "Installing vosk..."
pip3 install vosk || handle_error "Failed to install vosk"
# Clone the nerd-dictation repository
echo "Cloning nerd-dictation repository..."
git clone https://github.com/ideasman42/nerd-dictation.git || handle_error "Failed to clone nerd-dictation repository"
# Change directory to nerd-dictation
echo "Changing directory to nerd-dictation..."
cd nerd-dictation || handle_error "Failed to change directory to nerd-dictation"
# Download the vosk model
echo "Downloading vosk model..."
wget https://alphacephei.com/kaldi/models/vosk-model-small-en-us-0.15.zip || handle_error "Failed to download vosk model"
# Unzip the vosk model
echo "Unzipping vosk model..."
unzip vosk-model-small-en-us-0.15.zip || handle_error "Failed to unzip vosk model"
# Move the unzipped model to the correct directory
echo "Moving model to the correct directory..."
mv vosk-model-small-en-us-0.15 model || handle_error "Failed to move model to the correct directory"
echo "Setup complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment