Skip to content

Commit

Permalink
whisper.objc : fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Nov 26, 2022
1 parent 67e819b commit c207eed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
2 changes: 2 additions & 0 deletions examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
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;
Expand Down Expand Up @@ -336,6 +337,7 @@
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;
Expand Down
8 changes: 4 additions & 4 deletions examples/whisper.objc/whisper.objc/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@ @implementation ViewController

- (void)setupAudioFormat:(AudioStreamBasicDescription*)format
{
format->mSampleRate = 16000;
format->mSampleRate = WHISPER_SAMPLE_RATE;
format->mFormatID = kAudioFormatLinearPCM;
format->mFramesPerPacket = 1;
format->mChannelsPerFrame = 1;
Expand Down
13 changes: 3 additions & 10 deletions whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions whisper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit c207eed

Please sign in to comment.