aashish1904
commited on
Commit
•
216849a
1
Parent(s):
4550229
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
base_model: "meta-llama/Meta-Llama-3-8B-Instruct"
|
5 |
+
library_name: transformers
|
6 |
+
tags:
|
7 |
+
- mergekit
|
8 |
+
- merge
|
9 |
+
- facebook
|
10 |
+
- meta
|
11 |
+
- pytorch
|
12 |
+
- llama
|
13 |
+
- llama-3
|
14 |
+
language:
|
15 |
+
- en
|
16 |
+
pipeline_tag: text-generation
|
17 |
+
license: other
|
18 |
+
license_name: llama3
|
19 |
+
license_link: LICENSE
|
20 |
+
inference: false
|
21 |
+
model_creator: MaziyarPanahi
|
22 |
+
model_name: Llama-3-13B-Instruct-v0.1
|
23 |
+
quantized_by: MaziyarPanahi
|
24 |
+
|
25 |
+
---
|
26 |
+
|
27 |
+
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
|
28 |
+
|
29 |
+
# QuantFactory/Llama-3-13B-Instruct-v0.1-GGUF
|
30 |
+
This is quantized version of [MaziyarPanahi/Llama-3-13B-Instruct-v0.1](https://huggingface.co/MaziyarPanahi/Llama-3-13B-Instruct-v0.1) created using llama.cpp
|
31 |
+
|
32 |
+
# Original Model Card
|
33 |
+
|
34 |
+
|
35 |
+
<img src="./llama-3-merges.webp" alt="Goku 8x22B v0.1 Logo" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
36 |
+
|
37 |
+
# Llama-3-13B-Instruct-v0.1
|
38 |
+
|
39 |
+
This model is a self-merge of `meta-llama/Meta-Llama-3-8B-Instruct` model.
|
40 |
+
|
41 |
+
# How to use
|
42 |
+
|
43 |
+
You can use this model by using `MaziyarPanahi/Llama-3-13B-Instruct-v0.1` as the model name in Hugging Face's
|
44 |
+
transformers library.
|
45 |
+
|
46 |
+
```python
|
47 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
48 |
+
from transformers import pipeline
|
49 |
+
import torch
|
50 |
+
|
51 |
+
model_id = "MaziyarPanahi/Llama-3-13B-Instruct-v0.1"
|
52 |
+
|
53 |
+
model = AutoModelForCausalLM.from_pretrained(
|
54 |
+
model_id,
|
55 |
+
torch_dtype=torch.float16,
|
56 |
+
device_map="auto",
|
57 |
+
trust_remote_code=True,
|
58 |
+
# attn_implementation="flash_attention_2"
|
59 |
+
)
|
60 |
+
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
62 |
+
model_id,
|
63 |
+
trust_remote_code=True
|
64 |
+
)
|
65 |
+
|
66 |
+
streamer = TextStreamer(tokenizer)
|
67 |
+
|
68 |
+
pipeline = pipeline(
|
69 |
+
"text-generation",
|
70 |
+
model=model,
|
71 |
+
tokenizer=tokenizer,
|
72 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
73 |
+
streamer=streamer
|
74 |
+
)
|
75 |
+
|
76 |
+
# Then you can use the pipeline to generate text.
|
77 |
+
|
78 |
+
messages = [
|
79 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
80 |
+
{"role": "user", "content": "Who are you?"},
|
81 |
+
]
|
82 |
+
|
83 |
+
prompt = tokenizer.apply_chat_template(
|
84 |
+
messages,
|
85 |
+
tokenize=False,
|
86 |
+
add_generation_prompt=True
|
87 |
+
)
|
88 |
+
|
89 |
+
terminators = [
|
90 |
+
tokenizer.eos_token_id,
|
91 |
+
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
92 |
+
]
|
93 |
+
|
94 |
+
outputs = pipeline(
|
95 |
+
prompt,
|
96 |
+
max_new_tokens=256,
|
97 |
+
eos_token_id=terminators,
|
98 |
+
do_sample=True,
|
99 |
+
temperature=0.6,
|
100 |
+
top_p=0.95,
|
101 |
+
)
|
102 |
+
print(outputs[0]["generated_text"][len(prompt):])
|
103 |
+
```
|
104 |
+
|
105 |
+
## Prompt template
|
106 |
+
|
107 |
+
```text
|
108 |
+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
109 |
+
|
110 |
+
You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>
|
111 |
+
|
112 |
+
what's 25-4*2+3<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
113 |
+
|
114 |
+
To evaluate this expression, we need to follow the order of operations (PEMDAS):
|
115 |
+
|
116 |
+
1. First, multiply 4 and 2: 4*2 = 8
|
117 |
+
2. Then, subtract 8 from 25: 25 - 8 = 17
|
118 |
+
3. Finally, add 3: 17 + 3 = 20
|
119 |
+
|
120 |
+
So, 25-4*2+3 = 20!<|eot_id|>
|
121 |
+
To evaluate this expression, we need to follow the order of operations (PEMDAS):
|
122 |
+
|
123 |
+
1. First, multiply 4 and 2: 4*2 = 8
|
124 |
+
2. Then, subtract 8 from 25: 25 - 8 = 17
|
125 |
+
3. Finally, add 3: 17 + 3 = 20
|
126 |
+
|
127 |
+
So, 25-4*2+3 = 20!
|
128 |
+
```
|