Skip to content

openai-whisper-cpp: 1.5.2 -> 1.5.4#279854

Merged
viraptor merged 1 commit intoNixOS:masterfrom
amalgame21:openai-whisper-cpp
Jan 15, 2024
Merged

openai-whisper-cpp: 1.5.2 -> 1.5.4#279854
viraptor merged 1 commit intoNixOS:masterfrom
amalgame21:openai-whisper-cpp

Conversation

@amalgame21
Copy link
Contributor

Description of changes

openai-whisper-cpp: 1.5.2 -> 1.5.4
I would like to make a PR to add cudaSupport for 1.5.4 after this is merged.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@NixOSInfra NixOSInfra added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jan 9, 2024
@ofborg ofborg bot requested review from dit7ya and hughobrien January 9, 2024 15:52
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 9, 2024
@hughobrien
Copy link
Contributor

hughobrien commented Jan 9, 2024

The USAGE section of their script makes reference to functionality that is broken by removing the models_path code, could you also patch that out?

@hughobrien
Copy link
Contributor

Result of nixpkgs-review pr 279854 run on x86_64-linux 1

1 package built:
  • openai-whisper-cpp

@amalgame21
Copy link
Contributor Author

Sorry I deleted models_path because I was just following the result of the previous commit.
This is my first ever PR attempt, I will try to patch that out.
May I ask where I can find the USAGE section you mentioned so that I can follow?
Do you mean the Usage under the Docker section in their main github page?

@hughobrien
Copy link
Contributor

Here: https://github.com/ggerganov/whisper.cpp/blob/c46886f5991b0119db5eee76ad75e3801b240e7f/models/download-ggml-model.sh#L60

The current commit is failing with

       > applying patch /nix/store/v011mv5sspcjs7j631hdrdbjpg5cn6bv-download-models.patch
       > patching file models/download-ggml-model.sh
       > patch: **** malformed patch at line 21:  models=(

Patch files are not so easy to edit due to the metadata needing updating also. If you regenerate it it should work.

@hughobrien
Copy link
Contributor

Try this

--- a/models/download-ggml-model.sh
+++ b/models/download-ggml-model.sh
@@ -9,18 +9,6 @@
 src="https://huggingface.co/ggerganov/whisper.cpp"
 pfx="resolve/main/ggml"
 
-# get the path of this script
-function get_script_path() {
-    if [ -x "$(command -v realpath)" ]; then
-        echo "$(dirname "$(realpath "$0")")"
-    else
-        local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
-        echo "$ret"
-    fi
-}
-
-models_path="${2:-$(get_script_path)}"
-
 # Whisper models
 models=(
     "tiny.en"
@@ -56,8 +44,8 @@ function list_models {
     printf "\n\n"
 }
 
-if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
-    printf "Usage: $0 <model> [models_path]\n"
+if [ "$#" -ne 1 ]; then
+    printf "Usage: $0 <model>\n"
     list_models
 
     exit 1
@@ -82,8 +70,6 @@ fi
 
 printf "Downloading ggml model $model from '$src' ...\n"
 
-cd "$models_path"
-
 if [ -f "ggml-$model.bin" ]; then
     printf "Model $model already exists. Skipping download.\n"
     exit 0
@@ -105,7 +91,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-printf "Done! Model '$model' saved in '$models_path/ggml-$model.bin'\n"
+printf "Done! Model '$model' saved in 'ggml-$model.bin'\n"
 printf "You can now use it like this:\n\n"
-printf "  $ ./main -m $models_path/ggml-$model.bin -f samples/jfk.wav\n"
+printf "  $ ./main -m ggml-$model.bin -f samples/jfk.wav\n"
 printf "\n"

@amalgame21
Copy link
Contributor Author

Thank you very much for your help!

@hughobrien
Copy link
Contributor

No problem, remember you'll need to squash these commits down also. Something like below if you haven't done it before.

git reset --soft origin/master
git add .
git commit -m "openai-whisper-cpp: 1.5.2 -> 1.5.4"
git push -f

@amalgame21
Copy link
Contributor Author

Thanks for your reminder!
I am using github webpage only and I need some time to setup git to link to this account to squash those commits.

@amalgame21
Copy link
Contributor Author

wow magic

@hughobrien
Copy link
Contributor

Result of nixpkgs-review pr 279854 run on x86_64-linux 1

1 package built:
  • openai-whisper-cpp

@delroth delroth added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jan 10, 2024
@viraptor
Copy link
Contributor

works on aarch-darwin, thanks

@viraptor viraptor merged commit 3c193c9 into NixOS:master Jan 15, 2024
@amalgame21 amalgame21 deleted the openai-whisper-cpp branch December 28, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants