Spaces:
Sleeping
Sleeping
whisper.objc : add `-O3 -DNDEBUG` in release mode (#640)
Browse files
examples/whisper.objc/README.md
CHANGED
|
@@ -24,3 +24,5 @@ Also, don't forget to add the `-DGGML_USE_ACCELERATE` compiler flag in Build Pha
|
|
| 24 |
This can significantly improve the performance of the transcription:
|
| 25 |
|
| 26 |
<img width="1072" alt="image" src="https://user-images.githubusercontent.com/1991296/208511239-8d7cdbd1-aa48-41b5-becd-ca288d53cc07.png">
|
|
|
|
|
|
|
|
|
| 24 |
This can significantly improve the performance of the transcription:
|
| 25 |
|
| 26 |
<img width="1072" alt="image" src="https://user-images.githubusercontent.com/1991296/208511239-8d7cdbd1-aa48-41b5-becd-ca288d53cc07.png">
|
| 27 |
+
|
| 28 |
+
In this project, it also added `-O3 -DNDEBUG` to `Other C Flags`, but adding flags to app proj is not ideal in real world (applies to all C/C++ files), consider splitting xcodeproj in workspace in your own project.
|
examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
CHANGED
|
@@ -296,6 +296,10 @@
|
|
| 296 |
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
| 297 |
MTL_ENABLE_DEBUG_INFO = NO;
|
| 298 |
MTL_FAST_MATH = YES;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
SDKROOT = iphoneos;
|
| 300 |
VALIDATE_PRODUCT = YES;
|
| 301 |
};
|
|
|
|
| 296 |
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
| 297 |
MTL_ENABLE_DEBUG_INFO = NO;
|
| 298 |
MTL_FAST_MATH = YES;
|
| 299 |
+
OTHER_CFLAGS = (
|
| 300 |
+
"-O3",
|
| 301 |
+
"-DNDEBUG",
|
| 302 |
+
);
|
| 303 |
SDKROOT = iphoneos;
|
| 304 |
VALIDATE_PRODUCT = YES;
|
| 305 |
};
|
examples/whisper.swiftui/README.md
CHANGED
|
@@ -7,8 +7,9 @@ To use:
|
|
| 7 |
2. Add the model to "whisper.swiftui.demo/Resources/models" via Xcode.
|
| 8 |
3. Select a sample audio file (for example, [jfk.wav](https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav)).
|
| 9 |
4. Add the model to "whisper.swiftui.demo/Resources/samples" via Xcode.
|
| 10 |
-
5. Select the "
|
| 11 |
|
| 12 |
[^1]: I recommend the tiny, base or small models for running on an iOS device.
|
|
|
|
| 13 |
|
| 14 |

|
|
|
|
| 7 |
2. Add the model to "whisper.swiftui.demo/Resources/models" via Xcode.
|
| 8 |
3. Select a sample audio file (for example, [jfk.wav](https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav)).
|
| 9 |
4. Add the model to "whisper.swiftui.demo/Resources/samples" via Xcode.
|
| 10 |
+
5. Select the "Release" [^2] build configuration under "Run", then deploy and run to your device.
|
| 11 |
|
| 12 |
[^1]: I recommend the tiny, base or small models for running on an iOS device.
|
| 13 |
+
[^2]: The `Release` build can boost performance of transcription. In this project, it also added `-O3 -DNDEBUG` to `Other C Flags`, but adding flags to app proj is not ideal in real world (applies to all C/C++ files), consider splitting xcodeproj in workspace in your own project.
|
| 14 |
|
| 15 |

|
examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.pbxproj
CHANGED
|
@@ -430,6 +430,10 @@
|
|
| 430 |
LLVM_LTO = YES;
|
| 431 |
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
| 432 |
MARKETING_VERSION = 1.0;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
PRODUCT_BUNDLE_IDENTIFIER = com.whispercppdemo.WhisperCppDemo;
|
| 434 |
PRODUCT_NAME = "$(TARGET_NAME)";
|
| 435 |
SDKROOT = auto;
|
|
|
|
| 430 |
LLVM_LTO = YES;
|
| 431 |
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
| 432 |
MARKETING_VERSION = 1.0;
|
| 433 |
+
OTHER_CFLAGS = (
|
| 434 |
+
"-O3",
|
| 435 |
+
"-DNDEBUG",
|
| 436 |
+
);
|
| 437 |
PRODUCT_BUNDLE_IDENTIFIER = com.whispercppdemo.WhisperCppDemo;
|
| 438 |
PRODUCT_NAME = "$(TARGET_NAME)";
|
| 439 |
SDKROOT = auto;
|