llama : fix some -Wunused warnings
This commit is contained in:
parent
ceee3a6c22
commit
1dd3fd9323
1 changed files with 2 additions and 23 deletions
25
llama.cpp
25
llama.cpp
|
@ -3052,33 +3052,10 @@ static bool llama_is_control_token(const llama_vocab & vocab, llama_token id) {
|
||||||
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_CONTROL;
|
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_CONTROL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool llama_is_user_defined_token(const llama_vocab & vocab, llama_token id) {
|
|
||||||
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_USER_DEFINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool llama_is_unused_token(const llama_vocab & vocab, llama_token id) {
|
|
||||||
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_UNUSED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool llama_is_byte_token(const llama_vocab & vocab, llama_token id) {
|
static bool llama_is_byte_token(const llama_vocab & vocab, llama_token id) {
|
||||||
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_BYTE;
|
return vocab.id_to_token[id].type == LLAMA_TOKEN_TYPE_BYTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool llama_is_bos_token(const llama_vocab & vocab, llama_token id) {
|
|
||||||
GGML_ASSERT(llama_is_control_token(vocab, id));
|
|
||||||
return id == vocab.special_bos_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool llama_is_eos_token(const llama_vocab & vocab, llama_token id ) {
|
|
||||||
GGML_ASSERT(llama_is_control_token(vocab, id));
|
|
||||||
return id == vocab.special_eos_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool llama_is_pad_token(const llama_vocab & vocab, llama_token id ) {
|
|
||||||
GGML_ASSERT(id < 0 || llama_is_control_token(vocab, id));
|
|
||||||
return id == vocab.special_pad_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t llama_token_to_byte(const llama_vocab & vocab, llama_token id) {
|
static uint8_t llama_token_to_byte(const llama_vocab & vocab, llama_token id) {
|
||||||
GGML_ASSERT(llama_is_byte_token(vocab, id));
|
GGML_ASSERT(llama_is_byte_token(vocab, id));
|
||||||
const auto& token_data = vocab.id_to_token.at(id);
|
const auto& token_data = vocab.id_to_token.at(id);
|
||||||
|
@ -4800,9 +4777,11 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
|
||||||
std::vector<std::thread> workers;
|
std::vector<std::thread> workers;
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
|
|
||||||
|
#ifdef GGML_USE_K_QUANTS
|
||||||
auto use_more_bits = [] (int i_layer, int num_layers) -> bool {
|
auto use_more_bits = [] (int i_layer, int num_layers) -> bool {
|
||||||
return i_layer < num_layers/8 || i_layer >= 7*num_layers/8 || (i_layer - num_layers/8)%3 == 2;
|
return i_layer < num_layers/8 || i_layer >= 7*num_layers/8 || (i_layer - num_layers/8)%3 == 2;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue