blob: 54acdfb55bf3d7f4c49bdd7e4a9ae7165a6cf509 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
_baseurl='https://github.com/ggerganov/whisper.cpp'
_model='large-v3-turbo-q5_0'
_model_sha256sum='394221709cd5ad1f40c46e6031ca61bce88931e6e088c188294c6d5a55ffa7e2'
_pkgbase='whisper.cpp-model'
# Maintainer: Hauke Rehfeld <aur@haukerehfeld.de>
pkgname="${_pkgbase}-${_model}"
# our own artificial version number, but per model
pkgver=4
pkgrel=4
pkgdesc="This is an autogenerated file, please see https://github.com/hrehfeld/archlinux-whisper.cpp-model"
arch=("i686" "x86_64")
url="${_baseurl}/tree/master/models"
license=("MIT")
makedepends=()
depends=()
conflicts=()
provides=()
_model_file="ggml-${_model}.bin"
_model_path="/usr/share/$pkgname/${_model_file}"
__model_url() {
local model=$1
# copied from https://github.com/ggerganov/whisper.cpp/raw/master/models/download-ggml-model.sh
local src="https://huggingface.co/ggerganov/whisper.cpp"
local pfx="resolve/main/ggml"
if echo "$model" | grep -q "tdrz"; then
local src="https://huggingface.co/akashmjn/tinydiarize-whisper.cpp"
local pfx="resolve/main/ggml"
fi
echo $src/$pfx-"$model".bin
}
source=("$_model_file::$(__model_url $_model)")
sha256sums=("$_model_sha256sum")
package() {
install -Dm644 "${srcdir}/${_model_file}" "$pkgdir$_model_path"
wrapper="whisper.cpp-${_model}"
echo "#!/bin/sh
/usr/bin/whisper.cpp --model ${_model_path} "\"'$@'\" > "$srcdir/$wrapper"
install -Dm755 "${srcdir}/$wrapper" "$pkgdir/usr/bin/$wrapper"
}
|