Skip to content

Commit b777a1c

Browse files
committed
support ling-lite-1.5 & ring-lite
1 parent febc457 commit b777a1c

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6325,7 +6325,8 @@ def state_dict_pp(cls, config, state_dict):
63256325
if name == 'model.word_embeddings.weight':
63266326
r['model.embed_tokens.weight'] = tensor
63276327
elif name == "lm_head.weight":
6328-
tensor = tensor / (torch.norm(tensor, p=2, dim=0, keepdim=True) + 1e-7)
6328+
if config.norm_head:
6329+
tensor = tensor / (torch.norm(tensor, p=2, dim=0, keepdim=True) + 1e-7)
63296330
r[name] = tensor
63306331
elif name.endswith('query_key_value.weight'):
63316332
head_dim = config.head_dim
@@ -6346,7 +6347,6 @@ def state_dict_pp(cls, config, state_dict):
63466347

63476348
@staticmethod
63486349
def dump_config(f, config, ggml_type):
6349-
assert config.norm_head
63506350
if config.moe_layer_freq is None: config.moe_layer_freq = 1
63516351
if config.attention_bias is None: config.attention_bias = False
63526352
if config.scoring_func is None: config.scoring_func = 'softmax'

docs/models.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@
112112
[Coder-8B-Instruct](https://huggingface.co/JT-LM/JT-Coder-8B-Instruct/tree/9160d51e9acaae266cfef8493ea25d15e7ed6904),
113113
[DA-8B](https://huggingface.co/JT-LM/JT-DA-8B/commit/8bd5bb1a76305dcc777786b65c239b362cee808e)
114114

115-
* Ling (`BailingMoeForCausalLM`)
115+
* Ling/Ring (`BailingMoeForCausalLM`)
116116
* [x] [Lite](https://huggingface.co/inclusionAI/Ling-lite/tree/a80ae6c479251f1ae33dda517ab83cdc6a312f99), [Coder-Lite](https://huggingface.co/inclusionAI/Ling-Coder-lite/tree/4a8647acf9d3855d599adaaaf4bf6ca14239d2ab)
117+
* [x] v1.5: [Ling-lite-1.5-2507](https://huggingface.co/inclusionAI/Ling-lite-1.5-2507/tree/6656efdc763a77102207fc66b176e4c5d07a316b), [Ring-lite2507](https://huggingface.co/inclusionAI/Ring-lite-2507/commit/8cf0ec244871c90102b353cef3568e061fd2504f)
117118

118119
* LlaMA-like (`LlamaForCausalLM`, `Llama4ForConditionalGeneration`):
119120
* [x] All LlaMA-1 models

models/bailing.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace chatllm::bailing::moe
2323
Tokenizer(const Config &config)
2424
: BaseTokenizer(config, &_chat_encoder)
2525
{
26-
sys_prompt = "";
26+
sys_prompt = "You are Ling, an assistant created by inclusionAI";
2727
}
2828

2929
size_t load(tokenizer::DataReader *buffer, int n_vocab) override
@@ -47,6 +47,16 @@ namespace chatllm::bailing::moe
4747
if (role_open_token_id >= 0)
4848
terminate_ids.insert(role_open_token_id);
4949

50+
int t = tp->PieceToId("<think>");
51+
if (t >= 0)
52+
{
53+
tp->OverrideTokenDecoding(t, "<think>");
54+
sys_prompt = "You are Ring, an assistant created by inclusionAI";
55+
}
56+
t = tp->PieceToId("</think>");
57+
if (t >= 0)
58+
tp->OverrideTokenDecoding(t, "</think>");
59+
5060
return size;
5161
}
5262

scripts/models.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,6 +2694,31 @@
26942694
"url": "chatllm_quantized_bailing/bailing-lite-0415.bin"
26952695
}
26962696
}
2697+
},
2698+
"lite-1.5-2507": {
2699+
"default": "q8",
2700+
"quantized": {
2701+
"q8": {
2702+
"size": 17856685024,
2703+
"url": "chatllm_quantized_bailing/ling-lite-1.5-2507.bin"
2704+
}
2705+
}
2706+
}
2707+
}
2708+
},
2709+
"ring": {
2710+
"brief": "Ring-lite is a lightweight, fully open-sourced MoE (Mixture of Experts) LLM designed for complex reasoning tasks.",
2711+
"default": "lite-2507",
2712+
"license": "MIT",
2713+
"variants": {
2714+
"lite-2507": {
2715+
"default": "q8",
2716+
"quantized": {
2717+
"q8": {
2718+
"size": 17856684480,
2719+
"url": "chatllm_quantized_bailing/ring-lite-2507.bin"
2720+
}
2721+
}
26972722
}
26982723
}
26992724
},

0 commit comments

Comments
 (0)