Views
No views yet
merge_plan.json、merge_stats.json)。注意:本模型為「Base」取向(未保證具備指令對齊/安全對齊行為)。如需對話/指令能力,建議自行再進行 SFT / DPO / RLHF 等微調流程。
config.json 為準:WeDLMForCausalLM(model_type: wedlm,需 trust_remote_code=True)num_hidden_layers: 52hidden_size: 4096intermediate_size: 14336num_attention_heads: 32num_key_value_heads: 8head_dim: 128max_position_embeddings: 16384rope_theta: 1,000,000vocab_size: 151,936dtype: bfloat16transformers_version: 4.57.1(建議使用相同或更新版本)merge_plan.json:merge_strategy: dusoutput_layers: 52output_vocab: 151,936(沿用 main 的 vocab)out_layer 計):
out_layer 0–27:來自 main(對應 src_layer 0–27)out_layer 28–51:來自 sub(對應 src_layer 8–31)merge_stats.json):shape_expansions: 84verification_issues: 0global_verification_issues: 0model-0000x-of-00005.safetensors + model.safetensors.index.jsonconfiguration_wedlm.pymodeling_wedlm.pytokenizer.json、tokenizer_config.json、special_tokens_map.jsonchat_template.jinjamerge_plan.jsonmerge_stats.json1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "win10/Llama-3.3-WeDLM-12B-Base-Up-Scaling"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 trust_remote_code=True,
10 torch_dtype=torch.bfloat16,
11 device_map="auto",
12)
13
14prompt = "The theory of relativity states that"
15inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
16
17with torch.no_grad():
18 out = model.generate(
19 **inputs,
20 max_new_tokens=256,
21 do_sample=True,
22 temperature=0.7,
23 top_p=0.95,
24 )
25
26print(tokenizer.decode(out[0], skip_special_tokens=True))wedlm engine;若你的環境已能使用該推理引擎,可將 model_id 指向本倉庫模型以測試可用性(具體支援程度依你使用的 engine 版本而定)。pip install git+https://github.com/tencent/WeDLM.git1from wedlm import LLM, SamplingParams
2
3model_id = "win10/Llama-3.3-WeDLM-12B-Base-Up-Scaling"
4llm = LLM(model=model_id)
5
6prompt = "The theory of relativity states that"
7outputs = llm.generate([prompt], SamplingParams(max_tokens=256))
8print(outputs[0]["text"])tencent/WeDLM-8B-Base:Apache-2.0shb777/Llama-3.3-8B-Instruct-128K(以及其上游 Llama 3.3 系列):Llama 3.3 Community License(Hugging Face 顯示為 llama3.3)
資料依據(上游授權與模型描述、以及本倉庫合併規格/設定):WeDLM 模型頁的授權與使用方式 :contentReference[oaicite:0]{index=0};Llama 3.3 8B Instruct(allura-forge)授權標示 :contentReference[oaicite:1]{index=1};shb777 128K 版本授權標示 :contentReference[oaicite:2]{index=2};本倉庫檔案列表與合併檔案(`merge_plan.json`、`merge_stats.json`、`config.json`) :contentReference[oaicite:3]{index=3}
::contentReference[oaicite:4]{index=4}