Skip to content

Commit

Permalink
Renamed ggml to ggml-whisper to not conflict with Llama
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrohanea committed Nov 5, 2024
1 parent a0ea763 commit f2ef7b7
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 96 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CMakeList.txt : Top-level CMake project file, do global configuration
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)
Expand All @@ -13,3 +13,5 @@ project ("Whisper.net")

# Include sub-projects.
add_subdirectory ("whisper.cpp")

set_target_properties(ggml PROPERTIES OUTPUT_NAME "ggml-whisper")
46 changes: 23 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ wasm:
cmake --build build/wasm --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime/browser-wasm
cp build/wasm/whisper.cpp/src/libwhisper.a ./runtimes/Whisper.net.Runtime/browser-wasm/libwhisper.a
cp build/wasm/whisper.cpp/ggml/src/libggml.a ./runtimes/Whisper.net.Runtime/browser-wasm/libggml.a
cp build/wasm/whisper.cpp/ggml/src/libggml-whisper.a ./runtimes/Whisper.net.Runtime/browser-wasm/libggml-whisper.a


linux_x64:
Expand All @@ -58,39 +58,39 @@ linux_x64:
cmake --build build/linux-x64 --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime/linux-x64
cp build/linux-x64/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/linux-x64/libwhisper.so
cp build/linux-x64/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/linux-x64/libggml.so
cp build/linux-x64/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/linux-x64/libggml-whisper.so

linux_arm64:
rm -rf build/linux-arm64
cmake -S . -B build/linux-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64
cmake --build build/linux-arm64 --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime/linux-arm64
cp build/linux-arm64/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/linux-arm64/libwhisper.so
cp build/linux-arm64/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/linux-arm64/libggml.so
cp build/linux-arm64/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/linux-arm64/libggml-whisper.so

linux_arm:
rm -rf build/linux-arm
cmake -S . -B build/linux-arm -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=arm
cmake --build build/linux-arm --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime/linux-arm
cp build/linux-arm/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/linux-arm/libwhisper.so
cp build/linux-arm/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/linux-arm/libggml.so
cp build/linux-arm/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/linux-arm/libggml-whisper.so

linux_x64_cuda:
rm -rf build/linux-x64-cuda
cmake -S . -B build/linux-x64-cuda -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=x86_64-linux-gnu-g++ -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DGGML_CUDA=ON $(AVX_SUPPORT)
cmake --build build/linux-x64-cuda --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime.Cuda.Linux/linux-x64
cp build/linux-x64-cuda/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime.Cuda.Linux/linux-x64/libwhisper.so
cp build/linux-x64-cuda/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime.Cuda.Linux/linux-x64/libggml.so
cp build/linux-x64-cuda/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime.Cuda.Linux/linux-x64/libggml-whisper.so

linux_x64_noavx:
rm -rf build/linux-x64-noavx
cmake -S . -B build/linux-x64-noavx -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=x86_64-linux-gnu-g++ -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86_64 $(NOAVX_SUPPORT)
cmake --build build/linux-x64-noavx --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime.NoAvx/linux-x64
cp build/linux-x64-noavx/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime.NoAvx/linux-x64/libwhisper.so
cp build/linux-x64-noavx/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime.NoAvx/linux-x64/libggml.so
cp build/linux-x64-noavx/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime.NoAvx/linux-x64/libggml-whisper.so


linux_x64_openvino:
Expand All @@ -99,31 +99,31 @@ linux_x64_openvino:
cmake --build build/linux-x64-openvino --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime.OpenVino/linux-x64
cp build/linux-x64-openvino/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime.OpenVino/linux-x64/libwhisper.so
cp build/linux-x64-openvino/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime.OpenVino/linux-x64/libggml.so
cp build/linux-x64-openvino/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime.OpenVino/linux-x64/libggml-whisper.so

macos_x64:
rm -rf build/macos-x64
cmake -S . -DCMAKE_OSX_ARCHITECTURES="x86_64" -DGGML_METAL=OFF -B build/macos-x64
cmake --build build/macos-x64
mkdir -p runtimes/Whisper.net.Runtime/macos-x64
cp build/macos-x64/whisper.cpp/src/libwhisper.dylib ./runtimes/Whisper.net.Runtime/macos-x64/libwhisper.dylib
cp build/macos-x64/whisper.cpp/ggml/src/libggml.dylib ./runtimes/Whisper.net.Runtime/macos-x64/libggml.dylib
cp build/macos-x64/whisper.cpp/ggml/src/libggml-whisper.dylib ./runtimes/Whisper.net.Runtime/macos-x64/libggml-whisper.dylib

macos_arm64:
rm -rf build/macos-arm64
cmake -DCMAKE_OSX_ARCHITECTURES="arm64" -S . -B build/macos-arm64
cmake --build build/macos-arm64
mkdir -p runtimes/Whisper.net.Runtime/macos-arm64
cp build/macos-arm64/whisper.cpp/src/libwhisper.dylib ./runtimes/Whisper.net.Runtime/macos-arm64/libwhisper.dylib
cp build/macos-arm64/whisper.cpp/ggml/src/libggml.dylib ./runtimes/Whisper.net.Runtime/macos-arm64/libggml.dylib
cp build/macos-arm64/whisper.cpp/ggml/src/libggml-whisper.dylib ./runtimes/Whisper.net.Runtime/macos-arm64/libggml-whisper.dylib

macos_x64_coreml:
rm -rf build/macos-x64-coreml
cmake $(COREML_SUPPORT) -DCMAKE_OSX_ARCHITECTURES="x86_64" -DGGML_METAL=OFF -S . -B build/macos-x64-coreml
cmake --build build/macos-x64-coreml
mkdir -p runtimes/Whisper.net.Runtime.CoreML/macos-x64
cp build/macos-x64-coreml/whisper.cpp/src/libwhisper.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-x64/libwhisper.dylib
cp build/macos-x64-coreml/whisper.cpp/ggml/src/libggml.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-x64/libggml.dylib
cp build/macos-x64-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-x64/libggml-whisper.dylib
cp build/macos-x64-coreml/whisper.cpp/src/libwhisper.coreml.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-x64/libwhisper.coreml.dylib

macos_arm64_coreml:
Expand All @@ -133,15 +133,15 @@ macos_arm64_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/macos-arm64
cp build/macos-arm64-coreml/whisper.cpp/src/libwhisper.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-arm64/libwhisper.dylib
cp build/macos-arm64-coreml/whisper.cpp/src/libwhisper.coreml.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-arm64/libwhisper.coreml.dylib
cp build/macos-arm64-coreml/whisper.cpp/ggml/src/libggml.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-arm64/libggml.dylib
cp build/macos-arm64-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib ./runtimes/Whisper.net.Runtime.CoreML/macos-arm64/libggml-whisper.dylib

ios:
rm -rf build/ios
cmake $(CMAKE_PARAMETERS) -DCMAKE_OSX_SYSROOT="iphoneos" -S . -B build/ios
cmake --build build/ios
mkdir -p runtimes/Whisper.net.Runtime/ios-device
cp build/ios/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime/ios-device/libwhisper.dylib
cp build/ios/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime/ios-device/libggml.dylib
cp build/ios/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime/ios-device/libggml-whisper.dylib

ios_coreml:
rm -rf build/ios-coreml
Expand All @@ -150,15 +150,15 @@ ios_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/ios-device
cp build/ios-coreml/whisper.cpp/src/libwhisper.coreml.dylib runtimes/Whisper.net.Runtime.CoreML/ios-device/libwhisper.coreml.dylib
cp build/ios-coreml/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime.CoreML/ios-device/libwhisper.dylib
cp build/ios-coreml/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime.CoreML/ios-device/libggml.dylib
cp build/ios-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime.CoreML/ios-device/libggml-whisper.dylib

maccatalyst_arm64:
rm -rf build/maccatalyst_arm64
cmake $(CMAKE_PARAMETERS) -S . -B build/maccatalyst_arm64 -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_HOST_SYSTEM_PROCESSOR=arm64 -DGGML_METAL=OFF -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_CXX_FLAGS="-target arm64-apple-ios13.1-macabi" -DCMAKE_C_FLAGS="-target arm64-apple-ios13.1-macabi"
cmake --build build/maccatalyst_arm64
mkdir -p runtimes/Whisper.net.Runtime/maccatalyst
cp build/maccatalyst_arm64/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime/maccatalyst/libwhisper.dylib
cp build/maccatalyst_arm64/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime/maccatalyst/libggml.dylib
cp build/maccatalyst_arm64/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime/maccatalyst/libggml-whisper.dylib

maccatalyst_arm64_coreml:
rm -rf build/maccatalyst-arm64-coreml
Expand All @@ -167,7 +167,7 @@ maccatalyst_arm64_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/maccatalyst
cp build/maccatalyst-arm64-coreml/whisper.cpp/src/libwhisper.coreml.dylib runtimes/Whisper.net.Runtime.CoreML/maccatalyst/libwhisper.coreml.dylib
cp build/maccatalyst-arm64-coreml/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime.CoreML/maccatalyst/libwhisper.dylib
cp build/maccatalyst-arm64-coreml/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime.CoreML/maccatalyst/libggml.dylib
cp build/maccatalyst-arm64-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime.CoreML/maccatalyst/libggml-whisper.dylib

ios_simulator_coreml:
rm -rf build/ios-simulator-coreml
Expand All @@ -176,15 +176,15 @@ ios_simulator_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/ios-simulator
cp build/ios-simulator-coreml/whisper.cpp/src/libwhisper.coreml.dylib runtimes/Whisper.net.Runtime.CoreML/ios-simulator/libwhisper.coreml.dylib
cp build/ios-simulator-coreml/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime.CoreML/ios-simulator/libwhisper.dylib
cp build/ios-simulator-coreml/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime.CoreML/ios-simulator/libggml.dylib
cp build/ios-simulator-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime.CoreML/ios-simulator/libggml-whisper.dylib

ios_simulator_arm64:
rm -rf build/ios_simulator_arm64
cmake $(CMAKE_PARAMETERS) -DCMAKE_OSX_SYSROOT="iphonesimulator" -DGGML_METAL=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -S . -B build/ios_simulator_arm64
cmake --build build/ios_simulator_arm64
mkdir -p runtimes/Whisper.net.Runtime/ios-simulator
cp build/ios_simulator_arm64/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime/ios-simulator/libwhisper.dylib
cp build/ios_simulator_arm64/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime/ios-simulator/libggml.dylib
cp build/ios_simulator_arm64/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime/ios-simulator/libggml-whisper.dylib

tvos_simulator_arm64:
rm -rf build/tvos_simulator_arm64
Expand All @@ -199,7 +199,7 @@ tvos:
cmake --build build/tvos
mkdir -p runtimes/Whisper.net.Runtime/tvos-device
cp build/tvos/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime/tvos-device/libwhisper.dylib
cp build/tvos/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime/tvos-device/libggml.dylib
cp build/tvos/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime/tvos-device/libggml-whisper.dylib

tvos_coreml:
rm -rf build/tvos-coreml
Expand All @@ -208,7 +208,7 @@ tvos_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/tvos-device
cp build/tvos-coreml/whisper.cpp/src/libwhisper.coreml.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-device/libwhisper.coreml.dylib
cp build/tvos-coreml/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-device/libwhisper.dylib
cp build/tvos-coreml/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-device/libggml.dylib
cp build/tvos-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-device/libggml-whisper.dylib

tvos_simulator_coreml:
rm -rf build/tvos-simulator-coreml
Expand All @@ -217,31 +217,31 @@ tvos_simulator_coreml:
mkdir -p runtimes/Whisper.net.Runtime.CoreML/tvos-simulator
cp build/tvos-simulator-coreml/whisper.cpp/src/libwhisper.coreml.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-simulator/libwhisper.coreml.dylib
cp build/tvos-simulator-coreml/whisper.cpp/src/libwhisper.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-simulator/libwhisper.dylib
cp build/tvos-simulator-coreml/whisper.cpp/ggml/src/libggml.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-simulator/libggml.dylib
cp build/tvos-simulator-coreml/whisper.cpp/ggml/src/libggml-whisper.dylib runtimes/Whisper.net.Runtime.CoreML/tvos-simulator/libggml-whisper.dylib

android_arm64-v8a:
rm -rf build/android-arm64-v8a
cmake $(CMAKE_PARAMETERS) -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=21 -DCMAKE_ANDROID_NDK=$(NDK) -DGGML_OPENMP=OFF -S . -B build/android-arm64-v8a
cmake --build build/android-arm64-v8a
mkdir -p runtimes/Whisper.net.Runtime/android-arm64-v8a
cp build/android-arm64-v8a/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/android-arm64-v8a/libwhisper.so
cp build/android-arm64-v8a/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/android-arm64-v8a/libggml.so
cp build/android-arm64-v8a/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/android-arm64-v8a/libggml-whisper.so

android_x86:
rm -rf build/android-x86
cmake $(CMAKE_PARAMETERS) -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=21 -DCMAKE_ANDROID_NDK=$(NDK) -DGGML_OPENMP=OFF -S . -B build/android-x86
cmake --build build/android-x86
mkdir -p runtimes/Whisper.net.Runtime/android-x86
cp build/android-x86/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/android-x86/libwhisper.so
cp build/android-x86/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/android-x86/libggml.so
cp build/android-x86/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/android-x86/libggml-whisper.so

android_x64:
rm -rf build/android-x86_64
cmake $(CMAKE_PARAMETERS) -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=21 -DCMAKE_ANDROID_NDK=$(NDK) -DGGML_OPENMP=OFF -S . -B build/android-x86_64
cmake --build build/android-x86_64
mkdir -p runtimes/Whisper.net.Runtime/android-x86_64
cp build/android-x86_64/whisper.cpp/src/libwhisper.so ./runtimes/Whisper.net.Runtime/android-x86_64/libwhisper.so
cp build/android-x86_64/whisper.cpp/ggml/src/libggml.so ./runtimes/Whisper.net.Runtime/android-x86_64/libggml.so
cp build/android-x86_64/whisper.cpp/ggml/src/libggml-whisper.so ./runtimes/Whisper.net.Runtime/android-x86_64/libggml-whisper.so

xcframework:
mkdir -p output/lib
Expand Down
Loading

0 comments on commit f2ef7b7

Please sign in to comment.