Views
No views yet
| openPangu-Embedded-7B | |
|---|---|
| Architecture | Dense |
| Parameters (Non-Embedding) | 7B |
| Number of Layers | 34 |
| Hidden Dimension | 12800 |
| Attention Mechanism | GQA |
| Number of Attention Heads | 32 for Q,8 for KV |
| Vocabulary Size | 153k |
| Context Length (Natively) | 32k |
| Pretraining Tokens | 19T |
| Benchmark | Metric | Slow-thinking |
|---|---|---|
| General | ||
| MMLU-Pro | Exact Match | 76.32 |
| CMMLU | Acc | 75.59 |
| ArenaHard_v0.1 | w/o style control | 85.80 |
| C-Eval | Acc | 83.05 |
| GPQA-Diamond | Avg@4 | 70.54 |
| Math | ||
| MATH-500 | Avg@1 | 95.00 |
| AIME24 | Avg@16 | 71.57 |
| AIME25 | Avg@16 | 58.24 |
| Coding | ||
| LiveCodeBench | Avg@2 (08/24~01/25) | 54.04 |
| MBPP+ | Avg@2 | 76.06 |
1# Download model
2git lfs install
3git clone https://huggingface.co/FreedomIntelligence/openPangu-Embedded-7B
4
5# Install dependencies
6cd openPangu-Embedded-7B
7conda env create -f environment.yml
8conda activate panguchecklist.chk file.1#!/usr/bin/env bash
2ARCH=$(uname -m)
3MODEL_PATH="${TARGET_FOLDER}/${MODEL_FOLDER_PATH}"
4cd "$MODEL_PATH" || exit 1
5if [ "$ARCH" = "arm64" ]; then
6 sha256sum checklist.chk
7else
8 sha256sum -c checklist.chk
9fi1# coding=utf-8
2# Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
3
4from transformers import AutoModelForCausalLM, AutoTokenizer
5
6model_local_path = "FreedomIntelligence/openPangu-Embedded-7B"
7
8
9# load the tokenizer and the model
10tokenizer = AutoTokenizer.from_pretrained(
11 model_local_path,
12 use_fast=False,
13 trust_remote_code=True,
14 local_files_only=True
15)
16
17model = AutoModelForCausalLM.from_pretrained(
18 model_local_path,
19 trust_remote_code=True,
20 torch_dtype="auto",
21 device_map="auto",
22 local_files_only=True
23)
24
25# prepare the model input
26sys_prompt = "You must strictly comply with laws, regulations, and social ethics." \
27 "When generating content, avoid involving violence, pornography, terrorism, racial discrimination, gender discrimination, or other inappropriate content." \
28 "If such tendencies are detected in the input or output, refuse to answer and issue a warning. For example, if the input contains violent threats or pornographic descriptions," \
29 "return an error message: 'Your input contains inappropriate content and cannot be processed.'"
30
31prompt = "Give me a short introduction to large language model."
32no_thinking_prompt = prompt+" /no_think"
33messages = [
34 {"role": "system", "content": sys_prompt}, # define your system prompt here
35 {"role": "user", "content": prompt}
36]
37text = tokenizer.apply_chat_template(
38 messages,
39 tokenize=False,
40 add_generation_prompt=True
41)
42model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
43
44# conduct text completion
45outputs = model.generate(**model_inputs, max_new_tokens=32768, eos_token_id=45892, return_dict_in_generate=True)
46
47input_length = model_inputs.input_ids.shape[1]
48generated_tokens = outputs.sequences[:, input_length:]
49output_sent = tokenizer.decode(generated_tokens[0])
50
51# parsing thinking content
52thinking_content = output_sent.split("[unused17]")[0].split("[unused16]")[-1].strip()
53content = output_sent.split("[unused17]")[-1].split("[unused10]")[0].strip()
54
55print("\nthinking content:", thinking_content)
56print("\ncontent:", content)no_thinking_prompt variable demonstrates the specific implementation for switching to fast thinking mode: by appending the /no_think tag at the end of user input, the current turn can be switched to fast thinking mode. In this mode, thinking_content will be an empty value.1CUDA_VISIBLE_DEVICES=0 vllm serve FreedomIntelligence/openPangu-Embedded-7B --port 8818 --trust_remote_code --served-model-name openPangu-Embedded-7B
2
3# or
4CUDA_VISIBLE_DEVICES=0 \
5python -m vllm.entrypoints.openai.api_server \
6 --model FreedomIntelligence/openPangu-Embedded-1B \
7 --served-model-name openPangu-Embedded-7B \
8 --trust_remote_code \
9 --port 88181curl http://localhost:8818/v1/chat/completions -H "Content-Type: application/json" -d '{
2 "model": "openPangu-Embedded-7B",
3 "messages": [
4 {"role": "user", "content": "Give me a short introduction to large language models."}
5 ],
6 "temperature": 0.6,
7 "top_p": 0.95,
8 "top_k": 20,
9 "max_tokens": 8192
10 }'