Macos support whisper cpp (#1186)
* arm64 macos support whisper.cpp * add whisper binary for x64 macos
This commit is contained in:
@@ -60,7 +60,7 @@ test.afterAll(async () => {
|
||||
await electronApp.close();
|
||||
});
|
||||
|
||||
test("validate echogarden recognition", async () => {
|
||||
test("validate echogarden recognition by whisper", async () => {
|
||||
const res = await page.evaluate(() => {
|
||||
return window.__ENJOY_APP__.echogarden.check({
|
||||
engine: "whisper",
|
||||
@@ -76,6 +76,20 @@ test("validate echogarden recognition", async () => {
|
||||
expect(res.success).toBeTruthy();
|
||||
});
|
||||
|
||||
test("validate echogarden recognition by whisper.cpp", async () => {
|
||||
const res = await page.evaluate(() => {
|
||||
return window.__ENJOY_APP__.echogarden.check({
|
||||
engine: "whisper.cpp",
|
||||
whisperCpp: {
|
||||
model: "tiny.en",
|
||||
language: "en",
|
||||
},
|
||||
});
|
||||
});
|
||||
console.info(res.log);
|
||||
expect(res.success).toBeTruthy();
|
||||
});
|
||||
|
||||
test("valid ffmpeg command", async () => {
|
||||
const res = await page.evaluate(() => {
|
||||
return window.__ENJOY_APP__.ffmpeg.check();
|
||||
|
||||
7064
enjoy/lib/whisper.cpp/arm64/darwin/ggml-metal.metal
Normal file
7064
enjoy/lib/whisper.cpp/arm64/darwin/ggml-metal.metal
Normal file
File diff suppressed because it is too large
Load Diff
BIN
enjoy/lib/whisper.cpp/arm64/darwin/main
Executable file
BIN
enjoy/lib/whisper.cpp/arm64/darwin/main
Executable file
Binary file not shown.
7064
enjoy/lib/whisper.cpp/x64/darwin/ggml-metal.metal
Normal file
7064
enjoy/lib/whisper.cpp/x64/darwin/ggml-metal.metal
Normal file
File diff suppressed because it is too large
Load Diff
BIN
enjoy/lib/whisper.cpp/x64/darwin/main
Executable file
BIN
enjoy/lib/whisper.cpp/x64/darwin/main
Executable file
Binary file not shown.
@@ -68,6 +68,12 @@ class EchogardenWrapper {
|
||||
// Add temporary unhandledRejection listener
|
||||
process.on("unhandledRejection", handler);
|
||||
|
||||
// Set the whisper executable path for macOS
|
||||
if (process.platform === "darwin") {
|
||||
options.whisperCpp = options.whisperCpp || {};
|
||||
options.whisperCpp.executablePath = path.join(__dirname, "lib", "whisper", "main");
|
||||
}
|
||||
|
||||
// Call the original recognize function
|
||||
Echogarden.recognize(sampleFile, options)
|
||||
.then((result) => {
|
||||
@@ -97,6 +103,9 @@ class EchogardenWrapper {
|
||||
whisper: {
|
||||
model: "tiny.en",
|
||||
},
|
||||
whisperCpp: {
|
||||
model: "tiny.en",
|
||||
}
|
||||
}
|
||||
) {
|
||||
const sampleFile = path.join(__dirname, "samples", "jfk.wav");
|
||||
|
||||
@@ -116,7 +116,6 @@ export const EchogardenSttSettings = (props: {
|
||||
<SelectContent>
|
||||
<SelectItem value="whisper">Whisper</SelectItem>
|
||||
<SelectItem
|
||||
disabled={platformInfo?.platform === "darwin"}
|
||||
value="whisper.cpp"
|
||||
>
|
||||
Whisper.cpp
|
||||
|
||||
@@ -45,6 +45,12 @@ export default defineConfig((env) => {
|
||||
pluginHotRestart("restart"),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: `lib/whisper.cpp/${
|
||||
process.env.PACKAGE_OS_ARCH || os.arch()
|
||||
}/${os.platform()}/*`,
|
||||
dest: "lib/whisper",
|
||||
},
|
||||
{
|
||||
src: `lib/youtubedr/${
|
||||
process.env.PACKAGE_OS_ARCH || os.arch()
|
||||
|
||||
Reference in New Issue
Block a user