Chanjun commited on
Commit
10475dd
1 Parent(s): 5547af9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -8
README.md CHANGED
@@ -17,30 +17,53 @@ pipeline_tag: text-generation
17
  * **Language(s)**: English
18
  * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
19
  * **License**: Fine-tuned checkpoints is licensed under the Non-Commercial Creative Commons license ([CC BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/))
20
- * **Where to send comments**: Instructions on how to provide feedback or comments on a model can be found by opening an issue in the [Hugging Face community's model repository](https://huggingface.co/upstage/Llama-2-70b-instruct-1024/discussions)
21
  * **Contact**: For questions and comments about the model, please email [contact@upstage.ai](mailto:contact@upstage.ai)
22
 
23
  ## Dataset Details
24
 
25
  ### Used Datasets
26
  - Orca-style dataset
 
 
27
 
28
  ### Prompt Template
29
  ```
30
  ### System:
31
  {System}
32
-
33
  ### User:
34
  {User}
35
-
36
  ### Assistant:
37
  {Assistant}
38
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  ## Hardware and Software
41
 
42
  * **Hardware**: We utilized an A100x8 * 4 for training our model
43
- * **Training Factors**: We fine-tuned this model using a combination of the [DeepSpeed library](https://github.com/microsoft/DeepSpeed) and the [HuggingFace trainer](https://huggingface.co/docs/transformers/main_classes/trainer)
44
 
45
  ## Evaluation Results
46
 
@@ -49,14 +72,13 @@ pipeline_tag: text-generation
49
  We evaluated our model on four benchmark datasets, which include `ARC-Challenge`, `HellaSwag`, `MMLU`, and `TruthfulQA`.
50
  We used the [lm-evaluation-harness repository](https://github.com/EleutherAI/lm-evaluation-harness), specifically commit [b281b0921b636bc36ad05c0b0b0763bd6dd43463](https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463).
51
 
52
-
53
  ### Main Results
54
  | Model | H4(Avg) | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
55
  |--------------------------------------------------------------------|----------|----------|----------|------|----------|-|-------------|
56
  | **[Llama-2-70b-instruct-v2](https://huggingface.co/upstage/Llama-2-70b-instruct-v2)**(***Ours***, ***Local Reproduction***) | **72.7** | **71.6** | **87.7** | 69.7 | **61.6** | | **7.44063** |
57
  | [Llama-2-70b-instruct](https://huggingface.co/upstage/Llama-2-70b-instruct) (Ours, Open LLM Leaderboard) | 72.3 | 70.9 | 87.5 | **69.8** | 61 | | 7.24375 |
58
  | [llama-65b-instruct](https://huggingface.co/upstage/llama-65b-instruct) (Ours, Open LLM Leaderboard) | 69.4 | 67.6 | 86.5 | 64.9 | 58.8 | | |
59
- | Llama-2-70b-hf | 67.3 | 67.3 | 87.3 | 69.8 | 44.9 | | |
60
  | [llama-30b-instruct-2048](https://huggingface.co/upstage/llama-30b-instruct-2048) (Ours, Open LLM Leaderboard) | 67.0 | 64.9 | 84.9 | 61.9 | 56.3 | | |
61
  | [llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) (Ours, Open LLM Leaderboard) | 65.2 | 62.5 | 86.2 | 59.4 | 52.8 | | |
62
  | llama-65b | 64.2 | 63.5 | 86.1 | 63.9 | 43.4 | | |
@@ -67,10 +89,8 @@ We used the [lm-evaluation-harness repository](https://github.com/EleutherAI/lm-
67
  ```
68
  # clone the repository
69
  git clone https://github.com/EleutherAI/lm-evaluation-harness.git
70
-
71
  # check out the specific commit
72
  git checkout b281b0921b636bc36ad05c0b0b0763bd6dd43463
73
-
74
  # change to the repository directory
75
  cd lm-evaluation-harness
76
  ```
 
17
  * **Language(s)**: English
18
  * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
19
  * **License**: Fine-tuned checkpoints is licensed under the Non-Commercial Creative Commons license ([CC BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/))
20
+ * **Where to send comments**: Instructions on how to provide feedback or comments on a model can be found by opening an issue in the [Hugging Face community's model repository](https://huggingface.co/upstage/Llama-2-70b-instruct-v2/discussions)
21
  * **Contact**: For questions and comments about the model, please email [contact@upstage.ai](mailto:contact@upstage.ai)
22
 
23
  ## Dataset Details
24
 
25
  ### Used Datasets
26
  - Orca-style dataset
27
+ - Alpaca-Style Dataset
28
+
29
 
30
  ### Prompt Template
31
  ```
32
  ### System:
33
  {System}
 
34
  ### User:
35
  {User}
 
36
  ### Assistant:
37
  {Assistant}
38
  ```
39
+ ### Usage
40
+ - Tested on A100 80GB
41
+ - Our model can handle under 10k input tokens thanks to the `rope_scaling` option
42
+
43
+ ```python
44
+ import torch
45
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
46
+ tokenizer = AutoTokenizer.from_pretrained("upstage/Llama-2-70b-instruct-v2")
47
+ model = AutoModelForCausalLM.from_pretrained(
48
+ "upstage/Llama-2-70b-instruct-v2",
49
+ device_map='auto',
50
+ torch_dtype=torch.float16,
51
+ load_in_8bit=True,
52
+ rope_scaling={'type': 'dynamic', 'factor': 2} # longer inputs possible
53
+ )
54
+ prompt = "### User:\nThomas is very healthy, but he has to go to the hospital every day. What could be the reasons?\n\n### Assistant:\n"
55
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
56
+ del inputs['token_type_ids']
57
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
58
+ output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
59
+ output_text = tokenizer.decode(output[0], skip_special_tokens=True)
60
+ ```
61
+
62
 
63
  ## Hardware and Software
64
 
65
  * **Hardware**: We utilized an A100x8 * 4 for training our model
66
+ * **Training Factors**: We fine-tuned this model using a combination of the [DeepSpeed library](https://github.com/microsoft/DeepSpeed) and the [HuggingFace trainer](https://huggingface.co/docs/transformers/main_classes/trainer) / [HuggingFace Accelerate](https://huggingface.co/docs/accelerate/index)
67
 
68
  ## Evaluation Results
69
 
 
72
  We evaluated our model on four benchmark datasets, which include `ARC-Challenge`, `HellaSwag`, `MMLU`, and `TruthfulQA`.
73
  We used the [lm-evaluation-harness repository](https://github.com/EleutherAI/lm-evaluation-harness), specifically commit [b281b0921b636bc36ad05c0b0b0763bd6dd43463](https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463).
74
 
 
75
  ### Main Results
76
  | Model | H4(Avg) | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
77
  |--------------------------------------------------------------------|----------|----------|----------|------|----------|-|-------------|
78
  | **[Llama-2-70b-instruct-v2](https://huggingface.co/upstage/Llama-2-70b-instruct-v2)**(***Ours***, ***Local Reproduction***) | **72.7** | **71.6** | **87.7** | 69.7 | **61.6** | | **7.44063** |
79
  | [Llama-2-70b-instruct](https://huggingface.co/upstage/Llama-2-70b-instruct) (Ours, Open LLM Leaderboard) | 72.3 | 70.9 | 87.5 | **69.8** | 61 | | 7.24375 |
80
  | [llama-65b-instruct](https://huggingface.co/upstage/llama-65b-instruct) (Ours, Open LLM Leaderboard) | 69.4 | 67.6 | 86.5 | 64.9 | 58.8 | | |
81
+ | Llama-2-70b-hf | 67.3 | 67.3 | 87.3 | **69.8** | 44.9 | | |
82
  | [llama-30b-instruct-2048](https://huggingface.co/upstage/llama-30b-instruct-2048) (Ours, Open LLM Leaderboard) | 67.0 | 64.9 | 84.9 | 61.9 | 56.3 | | |
83
  | [llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) (Ours, Open LLM Leaderboard) | 65.2 | 62.5 | 86.2 | 59.4 | 52.8 | | |
84
  | llama-65b | 64.2 | 63.5 | 86.1 | 63.9 | 43.4 | | |
 
89
  ```
90
  # clone the repository
91
  git clone https://github.com/EleutherAI/lm-evaluation-harness.git
 
92
  # check out the specific commit
93
  git checkout b281b0921b636bc36ad05c0b0b0763bd6dd43463
 
94
  # change to the repository directory
95
  cd lm-evaluation-harness
96
  ```