From 9726d1e3dbee181371473c105f1478726b0995a0 Mon Sep 17 00:00:00 2001 From: Jhen Date: Thu, 7 Nov 2024 22:43:29 +0800 Subject: [PATCH] feat(example): move useFlashAttn usage to context-opts --- cpp/rn-whisper.cpp | 1 - example/ios/Podfile.lock | 10 +++++++++- example/src/Transcribe.tsx | 1 - example/src/context-opts.ios.ts | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cpp/rn-whisper.cpp b/cpp/rn-whisper.cpp index 13092459..641dfac7 100644 --- a/cpp/rn-whisper.cpp +++ b/cpp/rn-whisper.cpp @@ -84,7 +84,6 @@ std::string bench(struct whisper_context * ctx, int n_threads) { } } - const int64_t t_end_us = wsp_ggml_time_us(); const struct whisper_timings * timings = whisper_get_timings(ctx); const int32_t n_encode = std::max(1, timings->n_encode); diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 5cc48570..f1fba25e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1337,6 +1337,14 @@ PODS: - React-Codegen - React-Core - ReactCommon/turbomodule/core + - whisper-rn/no-require-arc (= 0.4.0-rc.8) + - whisper-rn/no-require-arc (0.4.0-rc.8): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - ReactCommon/turbomodule/core - Yoga (0.0.0) DEPENDENCIES: @@ -1600,7 +1608,7 @@ SPEC CHECKSUMS: RNZipArchive: 7bb4c70d6aa2dd235212c0a4a3de0a4e237e2569 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d SSZipArchive: c69881e8ac5521f0e622291387add5f60f30f3c4 - whisper-rn: d8fa919d9e9cffc1ac6e72d7da9a95b9d9344641 + whisper-rn: bbc8e83316260f5b4882a3c3f836b574649cc9e3 Yoga: 2655d94606b547901976080f15cdc6408575f699 PODFILE CHECKSUM: b3b0da61591aeebfbbfe372a869068f21e963e16 diff --git a/example/src/Transcribe.tsx b/example/src/Transcribe.tsx index d8c57e34..1ebf9a62 100644 --- a/example/src/Transcribe.tsx +++ b/example/src/Transcribe.tsx @@ -133,7 +133,6 @@ export default function App() { const startTime = Date.now() const ctx = await initWhisper({ filePath: require('../assets/ggml-base.bin'), - useFlashAttn: true, ...contextOpts, }) const endTime = Date.now() diff --git a/example/src/context-opts.ios.ts b/example/src/context-opts.ios.ts index 39a10570..eb5d14ab 100644 --- a/example/src/context-opts.ios.ts +++ b/example/src/context-opts.ios.ts @@ -15,4 +15,5 @@ export default { } : undefined, useGpu: false, // Enable Metal (Will skip Core ML if enabled) + useFlashAttn: false, }