Views
No views yet
| Dataset | Baichuan2-7B-Base | LLaMA-2-7B | Shell-7B |
|---|---|---|---|
| C-Eval | 56.3 | 32.5 | 50.13 |
| AGIEval | 34.6 | 21.8 | 30.69 |
| MMLU | 54.7 | 46.8 | 49.49 |
| CMMLU | 57 | 31.8 | 50.4 |
| GAOKAO-Bench | 34.8 | 18.9 | 33 |
| WiC | 50 | 50 | 50.47 |
| CHID | 82.7 | 46.5 | 83.17 |
| AFQMC | 58.4 | 69 | 69 |
| WSC | 66.3 | 66.3 | 63.46 |
| RACE(Middle) | 50.9 | 40.2 | 82.66 |
| RACE(High) | 52.5 | 37.5 | 74.24 |
| OpenbookQA | 32.8 | 57 | 79 |
| GSM8K | 24.6 | 16.7 | 20.7 |
| HumanEval | 17.7 | 12.8 | 23.96 |
| MBPP | 24 | 14.8 | 31.4 |
| BBH | 41.8 | 38.2 | 38.16 |
pip install -r requirements.txtgenerate方法让模型生成相关的文字。1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4device = 'cuda' if torch.cuda.is_available() else 'cpu'
5tokenizer = AutoTokenizer.from_pretrained("WisdomShell/Shell-7B-Base")
6model = AutoModelForCausalLM.from_pretrained("WisdomShell/Shell-7B-Base", trust_remote_code=True, torch_dtype=torch.bfloat16).to(device)
7inputs = tokenizer('你好', return_tensors='pt').to(device)
8outputs = model.generate(**inputs)
9print(tokenizer.decode(outputs[0]))chat方法与其进行对话。1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4device = 'cuda' if torch.cuda.is_available() else 'cpu'
5tokenizer = AutoTokenizer.from_pretrained("WisdomShell/Shell-7B-Chat")
6model = AutoModelForCausalLM.from_pretrained("WisdomShell/Shell-7B-Chat", trust_remote_code=True, torch_dtype=torch.bfloat16).to(device)
7history = []
8output = model.chat('你是谁', history, tokenizer)
9print(output)1[
2 {
3 "id": "identity_0",
4 "conversations": [
5 {
6 "from": "human",
7 "value": "你好"
8 },
9 {
10 "from": "assistant",
11 "value": "您好,我是Shell,请问有什么可以帮助您的吗?"
12 }
13 ]
14 }
15]https://127.0.0.1:8000进行访问。python demos/web_demo.pypython demos/cli_demo.pypython demos/openai_api.pycurl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Shell-7B-Chat",
"messages": [
{
"role": "user",
"content": "你好"
}
]
}'