BAAI
/

ldwang commited on
Commit
c105074
·
1 Parent(s): 46d15f0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -19
README.md CHANGED
@@ -9,16 +9,15 @@ license: other
9
  <h4 align="center">
10
  <p>
11
  <b>English</b> |
12
- <a href="https://huggingface.co/BAAI/AquilaChat2-7B/blob/main/README_zh.md">简体中文</a>
13
  </p>
14
  </h4>
15
 
16
-
17
- We opensource our **Aquila2** series, now including **Aquila2**, the base language models, namely **Aquila2-7B** and **Aquila2-34B**, as well as **AquilaChat2**, the chat models, namely **AquilaChat2-7B** and **AquilaChat2-34B**, as well as the long-text chat models, namely **AquilaChat2-7B-16k** and **AquilaChat2-34B-16k**
18
 
19
  The additional details of the Aquila model will be presented in the official technical report. Please stay tuned for updates on official channels.
20
 
21
- ## Quick Start AquilaChat2-7B(Chat model)
22
 
23
  ### 1. Inference
24
 
@@ -27,29 +26,19 @@ import torch
27
  from transformers import AutoTokenizer, AutoModelForCausalLM
28
  from transformers import BitsAndBytesConfig
29
 
30
- device = torch.device("cuda:0")
31
- model_info = "BAAI/AquilaChat2-7B"
32
  tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
33
- quantization_config=BitsAndBytesConfig(
34
- load_in_4bit=True,
35
- bnb_4bit_use_double_quant=True,
36
- bnb_4bit_quant_type="nf4",
37
- bnb_4bit_compute_dtype=torch.bfloat16,
38
- )
39
- model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, torch_dtype=torch.float16,
40
- # quantization_config=quantization_config, # Uncomment this line for 4bit quantization
41
- )
42
  model.eval()
43
- model.to(device)
44
  text = "请给出10个要到北京旅游的理由。"
45
  from predict import predict
46
  out = predict(model, text, tokenizer=tokenizer, max_gen_len=200, top_p=0.95,
47
- seed=1234, topk=100, temperature=0.9, sft=True, device=device,
48
- model_name="AquilaChat2-7B")
49
  print(out)
50
  ```
51
 
52
 
53
  ## License
54
 
55
- Aquila2 series open-source model is licensed under [ BAAI Aquila Model Licence Agreement](https://huggingface.co/BAAI/AquilaChat2-7B/blob/main/BAAI-Aquila-Model-License%20-Agreement.pdf)
 
9
  <h4 align="center">
10
  <p>
11
  <b>English</b> |
12
+ <a href="https://huggingface.co/BAAI/AquilaChat2-70B/blob/main/README_zh.md">简体中文</a>
13
  </p>
14
  </h4>
15
 
16
+ We opensource our **Aquila2** series, now including **Aquila2**, the base language models, namely **Aquila2-7B**, **Aquila2-34B** and **Aquila2-70B** , as well as **AquilaChat2**, the chat models, namely **AquilaChat2-7B**, **AquilaChat2-34B** and **AquilaChat2-70B**, as well as the long-text chat models, namely **AquilaChat2-7B-16k** and **AquilaChat2-34B-16k**
 
17
 
18
  The additional details of the Aquila model will be presented in the official technical report. Please stay tuned for updates on official channels.
19
 
20
+ ## Quick Start
21
 
22
  ### 1. Inference
23
 
 
26
  from transformers import AutoTokenizer, AutoModelForCausalLM
27
  from transformers import BitsAndBytesConfig
28
 
29
+ model_info = "BAAI/AquilaChat2-70B"
 
30
  tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
31
+ model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, torch_dtype=torch.bfloat16)
 
 
 
 
 
 
 
 
32
  model.eval()
 
33
  text = "请给出10个要到北京旅游的理由。"
34
  from predict import predict
35
  out = predict(model, text, tokenizer=tokenizer, max_gen_len=200, top_p=0.95,
36
+ seed=1234, topk=100, temperature=0.9, sft=True,
37
+ model_name="AquilaChat2-70B")
38
  print(out)
39
  ```
40
 
41
 
42
  ## License
43
 
44
+ Aquila2 series open-source model is licensed under [ BAAI Aquila Model Licence Agreement](https://huggingface.co/BAAI/AquilaChat2-70B/blob/main/BAAI-Aquila-Model-License-Agreement.pdf)