Skip to content

Commit b66c2fd

Browse files
committed
removing whitespace
1 parent 7e8e1a0 commit b66c2fd

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9329,7 +9329,7 @@ def prepare_tensors(self):
93299329
experts = [k for d in self._experts for k in d.keys()]
93309330
if len(experts) > 0:
93319331
raise ValueError(f"Unprocessed experts: {experts}")
9332-
9332+
93339333

93349334
@ModelBase.register("ModernBertModel", "ModernBertForMaskedLM", "ModernBertForSequenceClassification")
93359335
class ModernBertModel(BertModel):
@@ -9368,7 +9368,6 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
93689368
name = name[6:]
93699369

93709370
return super().modify_tensors(data_torch, name, bid)
9371-
93729371

93739372

93749373
@ModelBase.register("ApertusForCausalLM")

src/llama-model.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ void llama_model::load_hparams(llama_model_loader & ml) {
855855
type = LLM_TYPE_149M; break; // modern-bert-base
856856
case 28:
857857
type = LLM_TYPE_395M; break; // modern-bert-large
858-
default: type = LLM_TYPE_UNKNOWN;
858+
default: type = LLM_TYPE_UNKNOWN;
859859
}
860860
} break;
861861
case LLM_ARCH_JINA_BERT_V2:
@@ -2993,11 +2993,11 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
29932993
layer.layer_out_norm_b = create_tensor(tn(LLM_TENSOR_LAYER_OUT_NORM, "bias", i), {n_embd}, 0);
29942994
}
29952995
} break;
2996-
case LLM_ARCH_MODERN_BERT:
2996+
case LLM_ARCH_MODERN_BERT:
29972997
{
29982998
tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);
29992999
tok_norm = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD_NORM, "weight"), {n_embd}, 0);
3000-
3000+
30013001
output_norm = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);
30023002

30033003
for(int i = 0; i < n_layer; ++i) {
@@ -3006,15 +3006,15 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
30063006
if ( i != 0 ) {
30073007
layer.attn_norm = create_tensor(tn(LLM_TENSOR_ATTN_NORM, "weight", i), {n_embd}, 0);
30083008
} else{
3009-
// layer 0 uses identity
3009+
// layer 0 uses identity
30103010
layer.attn_norm = create_tensor(tn(LLM_TENSOR_ATTN_NORM, "weight", i), {n_embd}, TENSOR_NOT_REQUIRED);
30113011
}
30123012

30133013

30143014
layer.wqkv = create_tensor(tn(LLM_TENSOR_ATTN_QKV, "weight", i), {n_embd, 3 * n_embd }, 0);
30153015
layer.wo = create_tensor(tn(LLM_TENSOR_ATTN_OUT, "weight", i), {n_embd, n_embd}, 0);
30163016

3017-
layer.ffn_up = create_tensor(tn(LLM_TENSOR_FFN_UP, "weight", i), {n_embd, 2 * n_ff}, 0);
3017+
layer.ffn_up = create_tensor(tn(LLM_TENSOR_FFN_UP, "weight", i), {n_embd, 2 * n_ff}, 0);
30183018
layer.ffn_down = create_tensor(tn(LLM_TENSOR_FFN_DOWN, "weight", i), {n_ff, n_embd}, 0);
30193019
layer.ffn_norm = create_tensor(tn(LLM_TENSOR_FFN_NORM, "weight", i), {n_embd}, 0);
30203020
}
@@ -8209,7 +8209,7 @@ struct llm_build_modern_bert : public llm_graph_context {
82098209

82108210
ggml_tensor * cur = nullptr;
82118211
ggml_tensor * inpL = nullptr;
8212-
ggml_tensor * inp_pos = build_inp_pos();
8212+
ggml_tensor * inp_pos = build_inp_pos();
82138213

82148214
// construct input embeddings (token, type, position)
82158215
inpL = build_inp_embd(model.tok_embd);
@@ -8221,7 +8221,7 @@ struct llm_build_modern_bert : public llm_graph_context {
82218221

82228222
ggml_tensor * inp_out_ids = build_inp_out_ids();
82238223

8224-
auto * inp_attn = build_attn_inp_no_cache();
8224+
auto * inp_attn = build_attn_inp_no_cache();
82258225

82268226
for (int il = 0; il < n_layer; ++il) {
82278227
ggml_tensor * cur = inpL;
@@ -19831,7 +19831,7 @@ llama_memory_i * llama_model::create_memory(const llama_memory_params & params,
1983119831
case LLM_ARCH_NOMIC_BERT_MOE:
1983219832
case LLM_ARCH_NEO_BERT:
1983319833
case LLM_ARCH_WAVTOKENIZER_DEC:
19834-
case LLM_ARCH_MODERN_BERT:
19834+
case LLM_ARCH_MODERN_BERT:
1983519835
case LLM_ARCH_GEMMA_EMBEDDING:
1983619836
case LLM_ARCH_DREAM:
1983719837
case LLM_ARCH_LLADA:

0 commit comments

Comments
 (0)