Skip to content

Commit 6b80c74

Browse files
authored
completion : remove useless statics (#24226)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 588f0dc commit 6b80c74

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

tools/completion/completion.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@
3333
#endif
3434

3535
static llama_context ** g_ctx;
36-
static llama_model ** g_model;
3736
static common_sampler ** g_smpl;
3837
static common_params * g_params;
39-
static std::vector<llama_token> * g_input_tokens;
40-
static std::ostringstream * g_output_ss;
41-
static std::vector<llama_token> * g_output_tokens;
4238
static bool is_interacting = false;
4339
static bool need_insert_eot = false;
4440

@@ -136,7 +132,6 @@ int llama_completion(int argc, char ** argv) {
136132
llama_context * ctx = nullptr;
137133
common_sampler * smpl = nullptr;
138134

139-
g_model = &model;
140135
g_ctx = &ctx;
141136
g_smpl = &smpl;
142137

@@ -549,9 +544,9 @@ int llama_completion(int argc, char ** argv) {
549544
int n_consumed = 0;
550545
int n_session_consumed = 0;
551546

552-
std::vector<int> input_tokens; g_input_tokens = &input_tokens;
553-
std::vector<int> output_tokens; g_output_tokens = &output_tokens;
554-
std::ostringstream output_ss; g_output_ss = &output_ss;
547+
std::vector<int> input_tokens;
548+
std::vector<int> output_tokens;
549+
std::ostringstream output_ss;
555550
std::ostringstream assistant_ss; // for storing current assistant message, used in conversation mode
556551

557552
// the first thing we will do is to output the prompt, so set color accordingly

0 commit comments

Comments
 (0)