yoonniverse
commited on
Commit
•
76a162e
1
Parent(s):
3713916
Update README.md
Browse files
README.md
CHANGED
@@ -17,13 +17,14 @@ 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-
|
21 |
* **Contact**: For questions and comments about the model, please email [[email protected]](mailto:[email protected])
|
22 |
|
23 |
## Dataset Details
|
24 |
|
25 |
### Used Datasets
|
26 |
- Orca-style dataset
|
|
|
27 |
|
28 |
|
29 |
### Prompt Template
|
@@ -35,11 +36,35 @@ pipeline_tag: text-generation
|
|
35 |
### Assistant:
|
36 |
{Assistant}
|
37 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
## Hardware and Software
|
40 |
|
41 |
* **Hardware**: We utilized an A100x8 * 4 for training our model
|
42 |
-
* **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)
|
43 |
|
44 |
## Evaluation Results
|
45 |
|
@@ -49,7 +74,7 @@ We evaluated our model on four benchmark datasets, which include `ARC-Challenge`
|
|
49 |
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).
|
50 |
|
51 |
### Main Results
|
52 |
-
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
|
53 |
|-----------------------------------------------|---------|-------|-----------|-------|------------|-------|----------|
|
54 |
| **Llama-2-70b-instruct-v2** (***Ours***, ***Local Reproduction***) | **72.7** | **71.6** | **87.7** | **69.7** | **61.6** | | 7.440625 |
|
55 |
| Llama-2-70b-instruct (Ours, Local Reproduction) | 72.0 | 70.7 | 87.4 | 69.3 | 60.7 | | 7.24375 |
|
|
|
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 [[email protected]](mailto:[email protected])
|
22 |
|
23 |
## Dataset Details
|
24 |
|
25 |
### Used Datasets
|
26 |
- Orca-style dataset
|
27 |
+
- Alpaca-Style Dataset
|
28 |
|
29 |
|
30 |
### Prompt Template
|
|
|
36 |
### Assistant:
|
37 |
{Assistant}
|
38 |
```
|
39 |
+
### Usage
|
40 |
+
|
41 |
+
*Tested on A100 80GB*
|
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_prompt=True, skip_special_tokens=True)
|
60 |
+
```
|
61 |
+
|
62 |
+
Our model can handle >10k tokens thanks to the rope_scaling option.
|
63 |
|
64 |
## Hardware and Software
|
65 |
|
66 |
* **Hardware**: We utilized an A100x8 * 4 for training our model
|
67 |
+
* **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)
|
68 |
|
69 |
## Evaluation Results
|
70 |
|
|
|
74 |
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).
|
75 |
|
76 |
### Main Results
|
77 |
+
| Model | H4 Average | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
|
78 |
|-----------------------------------------------|---------|-------|-----------|-------|------------|-------|----------|
|
79 |
| **Llama-2-70b-instruct-v2** (***Ours***, ***Local Reproduction***) | **72.7** | **71.6** | **87.7** | **69.7** | **61.6** | | 7.440625 |
|
80 |
| Llama-2-70b-instruct (Ours, Local Reproduction) | 72.0 | 70.7 | 87.4 | 69.3 | 60.7 | | 7.24375 |
|