Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 11 additions & 3 deletions models/download-coreml-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ get_script_path() {
fi
}

models_path="$(get_script_path)"
script_path="$(get_script_path)"

# Check if the script is inside a /bin/ directory
case "$script_path" in
*/bin) default_download_path="$PWD" ;; # Use current directory as default download path if in /bin/
*) default_download_path="$script_path" ;; # Otherwise, use script directory
esac

models_path="${2:-$default_download_path}"

# Whisper models
models="tiny.en tiny base.en base small.en small medium.en medium large-v1 large-v2 large-v3 large-v3-turbo"
Expand All @@ -34,8 +42,8 @@ list_models() {
printf "\n\n"
}

if [ "$#" -ne 1 ]; then
printf "Usage: %s <model>\n" "$0"
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
printf "Usage: %s <model> [models_path]\n" "$0"
list_models

exit 1
Expand Down
10 changes: 9 additions & 1 deletion models/download-ggml-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ get_script_path() {
fi
}

models_path="${2:-$(get_script_path)}"
script_path="$(get_script_path)"

# Check if the script is inside a /bin/ directory
case "$script_path" in
*/bin) default_download_path="$PWD" ;; # Use current directory as default download path if in /bin/
*) default_download_path="$script_path" ;; # Otherwise, use script directory
esac

models_path="${2:-$default_download_path}"

# Whisper models
models="tiny
Expand Down
Loading