Replies: 3 comments 1 reply
-
Not directly related to your synthetic minimal model, but maybe of interest: Regarding your error message: You'd have to single step for the error, I'd start at init_mapping() in llama.cpp. |
Beta Was this translation helpful? Give feedback.
-
It's probably throwing when trying to find the newline token: |
Beta Was this translation helpful? Give feedback.
-
I am currently having this issue: llama-server -m example.gguf --slots --port 8080 build: 5004 (f52d59d7) with cc (Debian 12.2.0-14) 12.2.0 for x86_64-linux-gnu
system info: n_threads = 6, n_threads_batch = 6, total_threads = 12
system_info: n_threads = 6 (n_threads_batch = 6) / 12 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |
main: binding port with default address family
main: HTTP server is listening, hostname: 127.0.0.1, port: 8080, http threads: 11
main: loading model
srv load_model: loading model 'example.gguf'
llama_model_loader: loaded meta data with 20 key-value pairs and 3 tensors from example.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = llama
llama_model_loader: - kv 1: general.name str = py007_tinyllama-1.1b-chat-v0.3
llama_model_loader: - kv 2: llama.context_length u32 = 2048
llama_model_loader: - kv 3: llama.embedding_length u32 = 2048
llama_model_loader: - kv 4: llama.block_count u32 = 22
llama_model_loader: - kv 5: llama.feed_forward_length u32 = 5632
llama_model_loader: - kv 6: llama.rope.dimension_count u32 = 64
llama_model_loader: - kv 7: llama.attention.head_count u32 = 32
llama_model_loader: - kv 8: llama.attention.head_count_kv u32 = 4
llama_model_loader: - kv 9: llama.attention.layer_norm_rms_epsilon f32 = 0.000010
llama_model_loader: - kv 10: llama.rope.freq_base f32 = 10000.000000
llama_model_loader: - kv 11: general.file_type u32 = 10
llama_model_loader: - kv 12: tokenizer.ggml.model str = llama
llama_model_loader: - kv 13: tokenizer.ggml.tokens arr[str,4] = ["<unk>", "<s>", "</s>", "<0x00>"]
llama_model_loader: - kv 14: tokenizer.ggml.scores arr[f32,4] = [0.000000, 0.000000, 0.000000, 0.000000]
llama_model_loader: - kv 15: tokenizer.ggml.token_type arr[i32,4] = [2, 3, 3, 6]
llama_model_loader: - kv 16: tokenizer.ggml.bos_token_id u32 = 1
llama_model_loader: - kv 17: tokenizer.ggml.eos_token_id u32 = 2
llama_model_loader: - kv 18: tokenizer.ggml.unknown_token_id u32 = 0
llama_model_loader: - kv 19: general.quantization_version u32 = 2
llama_model_loader: - type f32: 3 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type = Q2_K - Medium
print_info: file size = 0.00 MiB (32.00 BPW)
load: SPM vocabulary, but newline token not found: unordered_map::at! Using special_pad_id instead.load: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect
load: special tokens cache size = 3
load: token to piece cache size = 0.0000 MB
print_info: arch = llama
print_info: vocab_only = 0
print_info: n_ctx_train = 2048
print_info: n_embd = 2048
print_info: n_layer = 22
print_info: n_head = 32
print_info: n_head_kv = 4
print_info: n_rot = 64
print_info: n_swa = 0
print_info: n_swa_pattern = 1
print_info: n_embd_head_k = 64
print_info: n_embd_head_v = 64
print_info: n_gqa = 8
print_info: n_embd_k_gqa = 256
print_info: n_embd_v_gqa = 256
print_info: f_norm_eps = 0.0e+00
print_info: f_norm_rms_eps = 1.0e-05
print_info: f_clamp_kqv = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale = 0.0e+00
print_info: f_attn_scale = 0.0e+00
print_info: n_ff = 5632
print_info: n_expert = 0
print_info: n_expert_used = 0
print_info: causal attn = 1
print_info: pooling type = 0
print_info: rope type = 0
print_info: rope scaling = linear
print_info: freq_base_train = 10000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn = 2048
print_info: rope_finetuned = unknown
print_info: ssm_d_conv = 0
print_info: ssm_d_inner = 0
print_info: ssm_d_state = 0
print_info: ssm_dt_rank = 0
print_info: ssm_dt_b_c_rms = 0
print_info: model type = 1B
print_info: model params = 0.19 K
print_info: general.name = py007_tinyllama-1.1b-chat-v0.3
print_info: vocab type = SPM
print_info: n_vocab = 4
print_info: n_merges = 0
print_info: BOS token = 1 '<s>'
print_info: EOS token = 2 '</s>'
print_info: UNK token = 0 '<unk>'
print_info: EOG token = 2 '</s>'
print_info: max token length = 6
load_tensors: loading model tensors, this can take a while... (mmap = true)
llama_model_load: error loading model: missing tensor 'token_embd.weight'
llama_model_load_from_file_impl: failed to load model
common_init_from_params: failed to load model 'example.gguf'
srv load_model: failed to load model, 'example.gguf'
srv operator(): operator(): cleaning up before exit...
main: exiting due to model loading error
terminate called without an active exception
Aborted Seems to be a problem with getting k quant type. |
Beta Was this translation helpful? Give feedback.
-
As a side-project, I'm attempting to create a minimal GGUF model that can successfully be loaded by llama.cpp (through llama-cpp-python) - very much related to this question: #5038
The code that I'd like to successfully run is:
or, somewhat similar from llama.cpp directly with
./llama.cpp/main -m minimal.gguf -I
I do not expect actual inference to work, I'd just like for it to be able to load the model.
Looking at
gguf-py/gguf-py/examples/writer.py
, I modified it as follows:That code produces a GGUF file, that if dumped with
llama.cpp/gguf-py/scripts/gguf-dump.py
looks like this:(I straight-up took all KV values from TheBlokes tinyllm model)
My issue is that when I try to load that model up with llama.cpp, I get this:
I can't seem to locate the source of the
error loading model: unordered_map::at: key not found
message, perhaps because I haven't touched C++ in a really, really long time.Does anyone have any pointers as to how to progress on this goal? Is there a better way to build a barebones minimal model?
Full disclosure, details on the internals of actual models elude me - this here is me embarking on the journey to learn more about these internals ;)
Beta Was this translation helpful? Give feedback.
All reactions