Skip to content

Commit 8ac8abb

Browse files
authored
expose.h: initialise constants (ggml-org#895)
This avoids compile-time warnings with clang: ./expose.h:66:15: note: const member 'seed' will never be initialized 66 | const int seed; | ^ No functional change intended.
1 parent 2f71687 commit 8ac8abb

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

expose.h

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -32,72 +32,72 @@ struct logit_bias {
3232
};
3333
struct load_model_inputs
3434
{
35-
const int threads;
36-
const int blasthreads;
37-
const int max_context_length;
38-
const bool low_vram;
39-
const bool use_mmq;
40-
const bool use_rowsplit;
41-
const char * executable_path;
42-
const char * model_filename;
43-
const char * lora_filename;
44-
const char * lora_base;
45-
const char * mmproj_filename;
46-
const bool use_mmap;
47-
const bool use_mlock;
48-
const bool use_smartcontext;
49-
const bool use_contextshift;
35+
const int threads = 0;
36+
const int blasthreads = 0;
37+
const int max_context_length = 0;
38+
const bool low_vram = 0;
39+
const bool use_mmq = 0;
40+
const bool use_rowsplit = 0;
41+
const char * executable_path = nullptr;
42+
const char * model_filename = nullptr;
43+
const char * lora_filename = nullptr;
44+
const char * lora_base = nullptr;
45+
const char * mmproj_filename = nullptr;
46+
const bool use_mmap = false;
47+
const bool use_mlock = false;
48+
const bool use_smartcontext = false;
49+
const bool use_contextshift = false;
5050
const int clblast_info = 0;
5151
const int cublas_info = 0;
52-
const char * vulkan_info;
52+
const char * vulkan_info = nullptr;
5353
const int blasbatchsize = 512;
5454
const int debugmode = 0;
5555
const int forceversion = 0;
5656
const int gpulayers = 0;
5757
const float rope_freq_scale = 1.0f;
5858
const float rope_freq_base = 10000.0f;
5959
const bool flash_attention = false;
60-
const float tensor_split[tensor_split_max];
60+
const float tensor_split[tensor_split_max] = {};
6161
const int quant_k = 0;
6262
const int quant_v = 0;
6363
};
6464
struct generation_inputs
6565
{
66-
const int seed;
67-
const char * prompt;
68-
const char * memory;
69-
const char * images[images_max];
70-
const int max_context_length;
71-
const int max_length;
72-
const float temperature;
73-
const int top_k;
66+
const int seed = 0;
67+
const char * prompt = nullptr;
68+
const char * memory = nullptr;
69+
const char * images[images_max] = {};
70+
const int max_context_length = 0;
71+
const int max_length = 0;
72+
const float temperature = 0.0f;
73+
const int top_k = 0;
7474
const float top_a = 0.0f;
75-
const float top_p;
75+
const float top_p = 0.0f;
7676
const float min_p = 0.0f;
77-
const float typical_p;
78-
const float tfs;
79-
const float rep_pen;
80-
const int rep_pen_range;
77+
const float typical_p = 0;
78+
const float tfs = 0;
79+
const float rep_pen = 0;
80+
const int rep_pen_range = 0;
8181
const float rep_pen_slope = 1.0f;
8282
const float presence_penalty = 0.0f;
8383
const int mirostat = 0;
84-
const float mirostat_eta;
85-
const float mirostat_tau;
86-
const samplers sampler_order[KCPP_SAMPLER_MAX];
87-
const int sampler_len;
88-
const bool allow_eos_token;
84+
const float mirostat_eta = 0.0f;
85+
const float mirostat_tau = 0.0f;
86+
const samplers sampler_order[KCPP_SAMPLER_MAX] = {};
87+
const int sampler_len = 0;
88+
const bool allow_eos_token = false;
8989
const bool bypass_eos_token = false;
90-
const bool render_special;
91-
const char * stop_sequence[stop_token_max];
92-
const bool stream_sse;
93-
const char * grammar;
94-
const bool grammar_retain_state;
90+
const bool render_special = false;
91+
const char * stop_sequence[stop_token_max] = {};
92+
const bool stream_sse = false;
93+
const char * grammar = nullptr;
94+
const bool grammar_retain_state = false;
9595
const bool quiet = false;
9696
const float dynatemp_range = 0.0f;
9797
const float dynatemp_exponent = 1.0f;
9898
const float smoothing_factor = 0.0f;
99-
const logit_bias logit_biases[logit_bias_max];
100-
const char * banned_tokens[ban_token_max];
99+
const logit_bias logit_biases[logit_bias_max] = {};
100+
const char * banned_tokens[ban_token_max] = {};
101101
};
102102
struct generation_outputs
103103
{
@@ -112,31 +112,31 @@ struct token_count_outputs
112112
};
113113
struct sd_load_model_inputs
114114
{
115-
const char * model_filename;
116-
const char * executable_path;
115+
const char * model_filename = nullptr;
116+
const char * executable_path = nullptr;
117117
const int clblast_info = 0;
118118
const int cublas_info = 0;
119-
const char * vulkan_info;
120-
const int threads;
119+
const char * vulkan_info = nullptr;
120+
const int threads = 0;
121121
const int quant = 0;
122122
const bool taesd = false;
123-
const char * vae_filename;
124-
const char * lora_filename;
123+
const char * vae_filename = nullptr;
124+
const char * lora_filename = nullptr;
125125
const float lora_multiplier = 1.0f;
126126
const int debugmode = 0;
127127
};
128128
struct sd_generation_inputs
129129
{
130-
const char * prompt;
131-
const char * negative_prompt;
130+
const char * prompt = nullptr;
131+
const char * negative_prompt = nullptr;
132132
const char * init_images = "";
133-
const float denoising_strength;
134-
const float cfg_scale;
135-
const int sample_steps;
136-
const int width;
137-
const int height;
138-
const int seed;
139-
const char * sample_method;
133+
const float denoising_strength = 0.0f;
134+
const float cfg_scale = 0.0f;
135+
const int sample_steps = 0;
136+
const int width = 0;
137+
const int height = 0;
138+
const int seed = 0;
139+
const char * sample_method = nullptr;
140140
const int clip_skip = -1;
141141
const bool quiet = false;
142142
};
@@ -147,17 +147,17 @@ struct sd_generation_outputs
147147
};
148148
struct whisper_load_model_inputs
149149
{
150-
const char * model_filename;
151-
const char * executable_path;
150+
const char * model_filename = nullptr;
151+
const char * executable_path = nullptr;
152152
const int clblast_info = 0;
153153
const int cublas_info = 0;
154-
const char * vulkan_info;
154+
const char * vulkan_info = nullptr;
155155
const int debugmode = 0;
156156
};
157157
struct whisper_generation_inputs
158158
{
159-
const char * prompt;
160-
const char * audio_data;
159+
const char * prompt = nullptr;
160+
const char * audio_data = nullptr;
161161
const bool quiet = false;
162162
};
163163
struct whisper_generation_outputs

0 commit comments

Comments
 (0)