]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper.objc : fix build warnings
authorGeorgi Gerganov <redacted>
Sat, 26 Nov 2022 14:27:04 +0000 (16:27 +0200)
committerGeorgi Gerganov <redacted>
Sat, 26 Nov 2022 14:27:04 +0000 (16:27 +0200)
examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
examples/whisper.objc/whisper.objc/ViewController.m
whisper.cpp
whisper.h

index bef9ce1e52fb12edcd2ee1d2c9ed1bec4cd62cad..9a9ee5465c4c676bf589469daaf4e76f0a5949f5 100644 (file)
                                CODE_SIGN_STYLE = Automatic;
                                CURRENT_PROJECT_VERSION = 1;
                                DEVELOPMENT_TEAM = P8JZH34X63;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
                                GENERATE_INFOPLIST_FILE = YES;
                                INFOPLIST_FILE = whisper.objc/Info.plist;
                                INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
                                CODE_SIGN_STYLE = Automatic;
                                CURRENT_PROJECT_VERSION = 1;
                                DEVELOPMENT_TEAM = P8JZH34X63;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
                                GENERATE_INFOPLIST_FILE = YES;
                                INFOPLIST_FILE = whisper.objc/Info.plist;
                                INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
index b23354bb0b558a25939cd40de735aeadf6e06f6d..4804471e81a2753142d72bb2ae3ab9457d295589 100644 (file)
@@ -21,9 +21,9 @@ void AudioInputCallback(void * inUserData,
 
 @interface ViewController ()
 
-@property (weak, nonatomic) IBOutlet UILabel *labelStatusInp;
-@property (weak, nonatomic) IBOutlet UIButton *buttonToggleCapture;
-@property (weak, nonatomic) IBOutlet UIButton *buttonTranscribe;
+@property (weak, nonatomic) IBOutlet UILabel    *labelStatusInp;
+@property (weak, nonatomic) IBOutlet UIButton   *buttonToggleCapture;
+@property (weak, nonatomic) IBOutlet UIButton   *buttonTranscribe;
 @property (weak, nonatomic) IBOutlet UITextView *textviewResult;
 
 @end
@@ -32,7 +32,7 @@ void AudioInputCallback(void * inUserData,
 
 - (void)setupAudioFormat:(AudioStreamBasicDescription*)format
 {
-    format->mSampleRate       = 16000;
+    format->mSampleRate       = WHISPER_SAMPLE_RATE;
     format->mFormatID         = kAudioFormatLinearPCM;
     format->mFramesPerPacket  = 1;
     format->mChannelsPerFrame = 1;
index de97bb7a3a714f04b62dae08754954843a4bfeb7..9e27ab13e86072e24452a2f146ee64ef1494d0ce 100644 (file)
@@ -2360,11 +2360,11 @@ whisper_token whisper_token_beg(struct whisper_context * ctx) {
     return ctx->vocab.token_beg;
 }
 
-whisper_token whisper_token_translate() {
+whisper_token whisper_token_translate(void) {
     return whisper_vocab::token_translate;
 }
 
-whisper_token whisper_token_transcribe() {
+whisper_token whisper_token_transcribe(void) {
     return whisper_vocab::token_transcribe;
 }
 
@@ -2921,10 +2921,6 @@ int whisper_full_parallel(
                 model.memory_cross_k = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
                 model.memory_cross_v = ggml_new_tensor_1d(ctx, GGML_TYPE_F16, n_elements);
             }
-
-            const size_t memory_size =
-                ggml_nbytes(model.memory_k)       + ggml_nbytes(model.memory_v) +
-                ggml_nbytes(model.memory_cross_k) + ggml_nbytes(model.memory_cross_v);
         }
     }
 
@@ -3044,7 +3040,7 @@ float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int
     return ctx->result_all[i_segment].tokens[i_token].p;
 }
 
-const char * whisper_print_system_info() {
+const char * whisper_print_system_info(void) {
     static std::string s;
 
     s  = "";
@@ -3145,9 +3141,6 @@ static void whisper_exp_compute_token_level_timestamps(
     const int64_t t0 = segment.t0;
     const int64_t t1 = segment.t1;
 
-    const int s0 = timestamp_to_sample(t0, n_samples);
-    const int s1 = timestamp_to_sample(t1, n_samples);
-
     const int n = tokens.size();
 
     if (n == 0) {
index 07d422c4d0ef1448e5467f59dee41ff7e94f86c1..b0fb2d9ac28c920f97af8f200b3f44c4dbb2b4ed 100644 (file)
--- a/whisper.h
+++ b/whisper.h
@@ -162,8 +162,8 @@ extern "C" {
     WHISPER_API whisper_token whisper_token_beg (struct whisper_context * ctx);
 
     // Task tokens
-    WHISPER_API whisper_token whisper_token_translate ();
-    WHISPER_API whisper_token whisper_token_transcribe();
+    WHISPER_API whisper_token whisper_token_translate (void);
+    WHISPER_API whisper_token whisper_token_transcribe(void);
 
     // Performance information
     WHISPER_API void whisper_print_timings(struct whisper_context * ctx);
@@ -276,7 +276,7 @@ extern "C" {
     WHISPER_API float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token);
 
     // Print system information
-    WHISPER_API const char * whisper_print_system_info();
+    WHISPER_API const char * whisper_print_system_info(void);
 
 #ifdef __cplusplus
 }