whisper.objc : fix build warnings

pull/194/head
Georgi Gerganov 2 years ago
parent 67e819baf4
commit c207eed431
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

@ -309,6 +309,7 @@
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = P8JZH34X63; DEVELOPMENT_TEAM = P8JZH34X63;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = whisper.objc/Info.plist; INFOPLIST_FILE = whisper.objc/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@ -336,6 +337,7 @@
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = P8JZH34X63; DEVELOPMENT_TEAM = P8JZH34X63;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = whisper.objc/Info.plist; INFOPLIST_FILE = whisper.objc/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

@ -32,7 +32,7 @@ void AudioInputCallback(void * inUserData,
- (void)setupAudioFormat:(AudioStreamBasicDescription*)format - (void)setupAudioFormat:(AudioStreamBasicDescription*)format
{ {
format->mSampleRate = 16000; format->mSampleRate = WHISPER_SAMPLE_RATE;
format->mFormatID = kAudioFormatLinearPCM; format->mFormatID = kAudioFormatLinearPCM;
format->mFramesPerPacket = 1; format->mFramesPerPacket = 1;
format->mChannelsPerFrame = 1; format->mChannelsPerFrame = 1;

@ -2360,11 +2360,11 @@ whisper_token whisper_token_beg(struct whisper_context * ctx) {
return ctx->vocab.token_beg; return ctx->vocab.token_beg;
} }
whisper_token whisper_token_translate() { whisper_token whisper_token_translate(void) {
return whisper_vocab::token_translate; return whisper_vocab::token_translate;
} }
whisper_token whisper_token_transcribe() { whisper_token whisper_token_transcribe(void) {
return whisper_vocab::token_transcribe; 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_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); 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; 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; static std::string s;
s = ""; s = "";
@ -3145,9 +3141,6 @@ static void whisper_exp_compute_token_level_timestamps(
const int64_t t0 = segment.t0; const int64_t t0 = segment.t0;
const int64_t t1 = segment.t1; 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(); const int n = tokens.size();
if (n == 0) { if (n == 0) {

@ -162,8 +162,8 @@ extern "C" {
WHISPER_API whisper_token whisper_token_beg (struct whisper_context * ctx); WHISPER_API whisper_token whisper_token_beg (struct whisper_context * ctx);
// Task tokens // Task tokens
WHISPER_API whisper_token whisper_token_translate (); WHISPER_API whisper_token whisper_token_translate (void);
WHISPER_API whisper_token whisper_token_transcribe(); WHISPER_API whisper_token whisper_token_transcribe(void);
// Performance information // Performance information
WHISPER_API void whisper_print_timings(struct whisper_context * ctx); 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); WHISPER_API float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token);
// Print system information // Print system information
WHISPER_API const char * whisper_print_system_info(); WHISPER_API const char * whisper_print_system_info(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

Loading…
Cancel
Save