Spaces:
Running
Running
whisper.objc : fix build warnings
Browse files
examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
CHANGED
|
@@ -309,6 +309,7 @@
|
|
| 309 |
CODE_SIGN_STYLE = Automatic;
|
| 310 |
CURRENT_PROJECT_VERSION = 1;
|
| 311 |
DEVELOPMENT_TEAM = P8JZH34X63;
|
|
|
|
| 312 |
GENERATE_INFOPLIST_FILE = YES;
|
| 313 |
INFOPLIST_FILE = whisper.objc/Info.plist;
|
| 314 |
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
|
@@ -336,6 +337,7 @@
|
|
| 336 |
CODE_SIGN_STYLE = Automatic;
|
| 337 |
CURRENT_PROJECT_VERSION = 1;
|
| 338 |
DEVELOPMENT_TEAM = P8JZH34X63;
|
|
|
|
| 339 |
GENERATE_INFOPLIST_FILE = YES;
|
| 340 |
INFOPLIST_FILE = whisper.objc/Info.plist;
|
| 341 |
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
|
|
|
| 309 |
CODE_SIGN_STYLE = Automatic;
|
| 310 |
CURRENT_PROJECT_VERSION = 1;
|
| 311 |
DEVELOPMENT_TEAM = P8JZH34X63;
|
| 312 |
+
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
| 313 |
GENERATE_INFOPLIST_FILE = YES;
|
| 314 |
INFOPLIST_FILE = whisper.objc/Info.plist;
|
| 315 |
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
|
|
|
| 337 |
CODE_SIGN_STYLE = Automatic;
|
| 338 |
CURRENT_PROJECT_VERSION = 1;
|
| 339 |
DEVELOPMENT_TEAM = P8JZH34X63;
|
| 340 |
+
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
| 341 |
GENERATE_INFOPLIST_FILE = YES;
|
| 342 |
INFOPLIST_FILE = whisper.objc/Info.plist;
|
| 343 |
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
examples/whisper.objc/whisper.objc/ViewController.m
CHANGED
|
@@ -21,9 +21,9 @@ void AudioInputCallback(void * inUserData,
|
|
| 21 |
|
| 22 |
@interface ViewController ()
|
| 23 |
|
| 24 |
-
@property (weak, nonatomic) IBOutlet UILabel
|
| 25 |
-
@property (weak, nonatomic) IBOutlet UIButton
|
| 26 |
-
@property (weak, nonatomic) IBOutlet UIButton
|
| 27 |
@property (weak, nonatomic) IBOutlet UITextView *textviewResult;
|
| 28 |
|
| 29 |
@end
|
|
@@ -32,7 +32,7 @@ void AudioInputCallback(void * inUserData,
|
|
| 32 |
|
| 33 |
- (void)setupAudioFormat:(AudioStreamBasicDescription*)format
|
| 34 |
{
|
| 35 |
-
format->mSampleRate =
|
| 36 |
format->mFormatID = kAudioFormatLinearPCM;
|
| 37 |
format->mFramesPerPacket = 1;
|
| 38 |
format->mChannelsPerFrame = 1;
|
|
|
|
| 21 |
|
| 22 |
@interface ViewController ()
|
| 23 |
|
| 24 |
+
@property (weak, nonatomic) IBOutlet UILabel *labelStatusInp;
|
| 25 |
+
@property (weak, nonatomic) IBOutlet UIButton *buttonToggleCapture;
|
| 26 |
+
@property (weak, nonatomic) IBOutlet UIButton *buttonTranscribe;
|
| 27 |
@property (weak, nonatomic) IBOutlet UITextView *textviewResult;
|
| 28 |
|
| 29 |
@end
|
|
|
|
| 32 |
|
| 33 |
- (void)setupAudioFormat:(AudioStreamBasicDescription*)format
|
| 34 |
{
|
| 35 |
+
format->mSampleRate = WHISPER_SAMPLE_RATE;
|
| 36 |
format->mFormatID = kAudioFormatLinearPCM;
|
| 37 |
format->mFramesPerPacket = 1;
|
| 38 |
format->mChannelsPerFrame = 1;
|
whisper.cpp
CHANGED
|
@@ -2360,11 +2360,11 @@ whisper_token whisper_token_beg(struct whisper_context * ctx) {
|
|
| 2360 |
return ctx->vocab.token_beg;
|
| 2361 |
}
|
| 2362 |
|
| 2363 |
-
whisper_token whisper_token_translate() {
|
| 2364 |
return whisper_vocab::token_translate;
|
| 2365 |
}
|
| 2366 |
|
| 2367 |
-
whisper_token whisper_token_transcribe() {
|
| 2368 |
return whisper_vocab::token_transcribe;
|
| 2369 |
}
|
| 2370 |
|
|
@@ -2921,10 +2921,6 @@ int whisper_full_parallel(
|
|
| 2921 |
model.memory_cross_k = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
|
| 2922 |
model.memory_cross_v = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
|
| 2923 |
}
|
| 2924 |
-
|
| 2925 |
-
const size_t memory_size =
|
| 2926 |
-
ggml_nbytes(model.memory_k) + ggml_nbytes(model.memory_v) +
|
| 2927 |
-
ggml_nbytes(model.memory_cross_k) + ggml_nbytes(model.memory_cross_v);
|
| 2928 |
}
|
| 2929 |
}
|
| 2930 |
|
|
@@ -3044,7 +3040,7 @@ float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int
|
|
| 3044 |
return ctx->result_all[i_segment].tokens[i_token].p;
|
| 3045 |
}
|
| 3046 |
|
| 3047 |
-
const char * whisper_print_system_info() {
|
| 3048 |
static std::string s;
|
| 3049 |
|
| 3050 |
s = "";
|
|
@@ -3145,9 +3141,6 @@ static void whisper_exp_compute_token_level_timestamps(
|
|
| 3145 |
const int64_t t0 = segment.t0;
|
| 3146 |
const int64_t t1 = segment.t1;
|
| 3147 |
|
| 3148 |
-
const int s0 = timestamp_to_sample(t0, n_samples);
|
| 3149 |
-
const int s1 = timestamp_to_sample(t1, n_samples);
|
| 3150 |
-
|
| 3151 |
const int n = tokens.size();
|
| 3152 |
|
| 3153 |
if (n == 0) {
|
|
|
|
| 2360 |
return ctx->vocab.token_beg;
|
| 2361 |
}
|
| 2362 |
|
| 2363 |
+
whisper_token whisper_token_translate(void) {
|
| 2364 |
return whisper_vocab::token_translate;
|
| 2365 |
}
|
| 2366 |
|
| 2367 |
+
whisper_token whisper_token_transcribe(void) {
|
| 2368 |
return whisper_vocab::token_transcribe;
|
| 2369 |
}
|
| 2370 |
|
|
|
|
| 2921 |
model.memory_cross_k = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
|
| 2922 |
model.memory_cross_v = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
|
| 2923 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2924 |
}
|
| 2925 |
}
|
| 2926 |
|
|
|
|
| 3040 |
return ctx->result_all[i_segment].tokens[i_token].p;
|
| 3041 |
}
|
| 3042 |
|
| 3043 |
+
const char * whisper_print_system_info(void) {
|
| 3044 |
static std::string s;
|
| 3045 |
|
| 3046 |
s = "";
|
|
|
|
| 3141 |
const int64_t t0 = segment.t0;
|
| 3142 |
const int64_t t1 = segment.t1;
|
| 3143 |
|
|
|
|
|
|
|
|
|
|
| 3144 |
const int n = tokens.size();
|
| 3145 |
|
| 3146 |
if (n == 0) {
|
whisper.h
CHANGED
|
@@ -162,8 +162,8 @@ extern "C" {
|
|
| 162 |
WHISPER_API whisper_token whisper_token_beg (struct whisper_context * ctx);
|
| 163 |
|
| 164 |
// Task tokens
|
| 165 |
-
WHISPER_API whisper_token whisper_token_translate ();
|
| 166 |
-
WHISPER_API whisper_token whisper_token_transcribe();
|
| 167 |
|
| 168 |
// Performance information
|
| 169 |
WHISPER_API void whisper_print_timings(struct whisper_context * ctx);
|
|
@@ -276,7 +276,7 @@ extern "C" {
|
|
| 276 |
WHISPER_API float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token);
|
| 277 |
|
| 278 |
// Print system information
|
| 279 |
-
WHISPER_API const char * whisper_print_system_info();
|
| 280 |
|
| 281 |
#ifdef __cplusplus
|
| 282 |
}
|
|
|
|
| 162 |
WHISPER_API whisper_token whisper_token_beg (struct whisper_context * ctx);
|
| 163 |
|
| 164 |
// Task tokens
|
| 165 |
+
WHISPER_API whisper_token whisper_token_translate (void);
|
| 166 |
+
WHISPER_API whisper_token whisper_token_transcribe(void);
|
| 167 |
|
| 168 |
// Performance information
|
| 169 |
WHISPER_API void whisper_print_timings(struct whisper_context * ctx);
|
|
|
|
| 276 |
WHISPER_API float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token);
|
| 277 |
|
| 278 |
// Print system information
|
| 279 |
+
WHISPER_API const char * whisper_print_system_info(void);
|
| 280 |
|
| 281 |
#ifdef __cplusplus
|
| 282 |
}
|