cmake -B build . -DGGML_VULKAN=ON -DBUILD_SHARED_LIBS=OFF -DGGML_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release
CMAKE_BUILD_PARALLEL_LEVEL=16 cmake --build build --target llama-cli --config Releasegit clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
git checkout fe36c90
wget.exe https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.26/OpenBLAS-0.3.26-x64.zip
$env:VULKAN_SDK = "C:\VulkanSDK\1.3.290.0"
$env:OPENBLAS_PATH = "$pwd/openblas"
$env:GGML_OPENBLAS = "1"
cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_VULKAN=ON -DGGML_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DGGML_STATIC=ON
cmake --build build --target main --config Release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| export model from https://github.com/microsoft/Olive/tree/main/examples/whisper | |
| Audio should be 16khz mono | |
| ffmpeg -i input.wav -ar 16000 -ac 1 -c:a pcm_s16le output.wav | |
| """ | |
| import numpy as np | |
| import onnxruntime | |
| from onnxruntime_extensions import get_library_path | |
| audio_file = "single.wav" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python3 -m venv venv | |
| # source venv/bin/activate | |
| # pip3 install onnxruntime numpy librosa | |
| # wget https://github.com/pengzhendong/pyannote-onnx/blob/master/pyannote_onnx/segmentation-3.0.onnx | |
| # wget https://github.com/thewh1teagle/sherpa-rs/releases/download/v0.1.0/motivation.wav -Otest.wav | |
| # python3 main.py | |
| import onnxruntime as ort | |
| import librosa | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ScreenCaptureKit | |
| import Cocoa | |
| let accessEnabled = CGPreflightScreenCaptureAccess() | |
| func openSystemPreferences() { | |
| let url = "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture" | |
| if let nsUrl = URL(string: url) { | |
| NSWorkspace.shared.open(nsUrl) | |
| } |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DSHERPA_ONNX_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DSHERPA_ONNX_ENABLE_DIRECTML=ON .
cmake --build build --config Release -j16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| wget https://github.com/thewh1teagle/vibe/raw/main/samples/short.wav | |
| wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.tar.bz2 | |
| tar xvf sherpa-onnx-whisper-tiny.tar.bz2 | |
| python -m venv venv | |
| pip install -r requirements.txt | |
| python main.py | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cargo : Compiling sherpa-rs-sys v0.1.0 (C:\Users\User\Documents\code\sherpa-rs\sys) | |
| At line:1 char:1 | |
| + cargo run --example basic_use 2>error.txt | |
| + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| + CategoryInfo : NotSpecified: ( Compiling sh...\sherpa-rs\sys):String) [], RemoteException | |
| + FullyQualifiedErrorId : NativeCommandError | |
| error: failed to run custom build command for `sherpa-rs-sys v0.1.0 (C:\Users\User\Documents\code\sherpa-rs\sys)` | |
| Caused by: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // windows = { version = "0.58.0", features = ["Win32", "Win32_UI", "Win32_UI_WindowsAndMessaging"] } | |
| #[tauri::command] | |
| fn set_app_visible(app: AppHandle, visible: bool) { | |
| use windows::Win32::UI::WindowsAndMessaging::{ | |
| GetWindowLongPtrW, SetWindowLongPtrW, GWL_EXSTYLE, WS_EX_APPWINDOW, WS_EX_TOOLWINDOW, | |
| }; | |
| use windows::Win32::Foundation::HWND; | |
| use std::os::raw::c_void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sqlite3 | |
| conn = sqlite3.connect('company.db') | |
| cursor = conn.cursor() | |
| cursor.execute(''' | |
| CREATE TABLE IF NOT EXISTS departments ( | |
| department_id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| name TEXT NOT NULL | |
| ) |