- Fix format issues
- Remove duplicate set kqv_out to llm_build_kv
This commit is contained in:
parent
e4a16f2493
commit
4364308210
2 changed files with 4 additions and 3 deletions
|
@ -778,6 +778,7 @@ class BaichuanModel(Model):
|
||||||
r = weights.shape[0] // 3
|
r = weights.shape[0] // 3
|
||||||
return weights[r * n_part:r * n_part + r, ...]
|
return weights[r * n_part:r * n_part + r, ...]
|
||||||
|
|
||||||
|
|
||||||
@Model.register("XverseForCausalLM")
|
@Model.register("XverseForCausalLM")
|
||||||
class XverseModel(Model):
|
class XverseModel(Model):
|
||||||
model_arch = gguf.MODEL_ARCH.XVERSE
|
model_arch = gguf.MODEL_ARCH.XVERSE
|
||||||
|
@ -882,7 +883,7 @@ class XverseModel(Model):
|
||||||
data_torch = self._reverse_hf_permute(data_torch, head_count, head_count)
|
data_torch = self._reverse_hf_permute(data_torch, head_count, head_count)
|
||||||
if name.endswith(("k_proj.weight")):
|
if name.endswith(("k_proj.weight")):
|
||||||
data_torch = self._reverse_hf_permute(data_torch, head_count, head_count_kv)
|
data_torch = self._reverse_hf_permute(data_torch, head_count, head_count_kv)
|
||||||
|
|
||||||
data = data_torch.squeeze().numpy()
|
data = data_torch.squeeze().numpy()
|
||||||
|
|
||||||
# map tensor names
|
# map tensor names
|
||||||
|
@ -918,7 +919,8 @@ class XverseModel(Model):
|
||||||
.swapaxes(1, 2)
|
.swapaxes(1, 2)
|
||||||
.reshape(weights.shape)
|
.reshape(weights.shape)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@Model.register("FalconForCausalLM", "RWForCausalLM")
|
@Model.register("FalconForCausalLM", "RWForCausalLM")
|
||||||
class FalconModel(Model):
|
class FalconModel(Model):
|
||||||
model_arch = gguf.MODEL_ARCH.FALCON
|
model_arch = gguf.MODEL_ARCH.FALCON
|
||||||
|
|
|
@ -6522,7 +6522,6 @@ struct llm_build_context {
|
||||||
cur = llm_build_kv(ctx0, model, hparams, kv_self, gf,
|
cur = llm_build_kv(ctx0, model, hparams, kv_self, gf,
|
||||||
model.layers[il].wo, NULL,
|
model.layers[il].wo, NULL,
|
||||||
Kcur, Vcur, Qcur, KQ_mask, KQ_pos, n_ctx, n_tokens, kv_head, n_kv, 1.0f/sqrtf(float(n_embd_head)), cb, il);
|
Kcur, Vcur, Qcur, KQ_mask, KQ_pos, n_ctx, n_tokens, kv_head, n_kv, 1.0f/sqrtf(float(n_embd_head)), cb, il);
|
||||||
cb(cur, "kqv_out", il);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (il == n_layer - 1) {
|
if (il == n_layer - 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue