alokabhishek
commited on
Commit
•
47e1276
1
Parent(s):
ab5d815
Added code snipped to show how to use
Browse files
README.md
CHANGED
@@ -22,97 +22,95 @@ This repo GGUF quantized version of Meta's meta-llama/Llama-2-7b-chat-hf model u
|
|
22 |
|
23 |
|
24 |
|
|
|
25 |
|
|
|
26 |
|
27 |
-
### Model Description
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
- **Funded by [optional]:** [More Information Needed]
|
35 |
-
- **Shared by [optional]:** [More Information Needed]
|
36 |
-
- **Model type:** [More Information Needed]
|
37 |
-
- **Language(s) (NLP):** [More Information Needed]
|
38 |
-
- **License:** [More Information Needed]
|
39 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
40 |
|
41 |
-
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
- **Paper [optional]:** [More Information Needed]
|
47 |
-
- **Demo [optional]:** [More Information Needed]
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
[More Information Needed]
|
58 |
|
59 |
-
### Downstream Use [optional]
|
60 |
|
61 |
-
|
|
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
[More Information Needed]
|
70 |
-
|
71 |
-
## Bias, Risks, and Limitations
|
72 |
-
|
73 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
74 |
-
|
75 |
-
[More Information Needed]
|
76 |
|
77 |
-
|
78 |
|
79 |
-
|
80 |
|
81 |
-
|
82 |
|
83 |
-
|
84 |
|
85 |
-
|
86 |
|
87 |
[More Information Needed]
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
### Training Data
|
92 |
|
93 |
-
<!-- This
|
94 |
|
95 |
[More Information Needed]
|
96 |
|
97 |
-
###
|
98 |
-
|
99 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
100 |
|
101 |
-
|
102 |
|
103 |
[More Information Needed]
|
104 |
|
|
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
109 |
-
|
110 |
-
#### Speeds, Sizes, Times [optional]
|
111 |
-
|
112 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
113 |
|
114 |
[More Information Needed]
|
115 |
|
|
|
116 |
## Evaluation
|
117 |
|
118 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
@@ -141,67 +139,6 @@ Use the code below to get started with the model.
|
|
141 |
|
142 |
[More Information Needed]
|
143 |
|
144 |
-
#### Summary
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
## Model Examination [optional]
|
149 |
-
|
150 |
-
<!-- Relevant interpretability work for the model goes here -->
|
151 |
-
|
152 |
-
[More Information Needed]
|
153 |
-
|
154 |
-
## Environmental Impact
|
155 |
-
|
156 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
157 |
-
|
158 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
159 |
-
|
160 |
-
- **Hardware Type:** [More Information Needed]
|
161 |
-
- **Hours used:** [More Information Needed]
|
162 |
-
- **Cloud Provider:** [More Information Needed]
|
163 |
-
- **Compute Region:** [More Information Needed]
|
164 |
-
- **Carbon Emitted:** [More Information Needed]
|
165 |
-
|
166 |
-
## Technical Specifications [optional]
|
167 |
-
|
168 |
-
### Model Architecture and Objective
|
169 |
-
|
170 |
-
[More Information Needed]
|
171 |
-
|
172 |
-
### Compute Infrastructure
|
173 |
-
|
174 |
-
[More Information Needed]
|
175 |
-
|
176 |
-
#### Hardware
|
177 |
-
|
178 |
-
[More Information Needed]
|
179 |
-
|
180 |
-
#### Software
|
181 |
-
|
182 |
-
[More Information Needed]
|
183 |
-
|
184 |
-
## Citation [optional]
|
185 |
-
|
186 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
187 |
-
|
188 |
-
**BibTeX:**
|
189 |
-
|
190 |
-
[More Information Needed]
|
191 |
-
|
192 |
-
**APA:**
|
193 |
-
|
194 |
-
[More Information Needed]
|
195 |
-
|
196 |
-
## Glossary [optional]
|
197 |
-
|
198 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
-
## More Information [optional]
|
203 |
-
|
204 |
-
[More Information Needed]
|
205 |
|
206 |
## Model Card Authors [optional]
|
207 |
|
|
|
22 |
|
23 |
|
24 |
|
25 |
+
# How to Get Started with the Model
|
26 |
|
27 |
+
Use the code below to get started with the model.
|
28 |
|
|
|
29 |
|
30 |
+
## How to run from Python code
|
31 |
|
32 |
+
#### First install the package
|
33 |
+
```shell
|
34 |
+
# Base ctransformers with CUDA GPU acceleration
|
35 |
+
! pip install ctransformers[cuda]>=0.2.24
|
36 |
+
# Or with no GPU acceleration
|
37 |
+
# ! pip install ctransformers>=0.2.24
|
38 |
+
! pip install -U sentence-transformers
|
39 |
+
! pip install transformers huggingface_hub torch
|
40 |
|
41 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
# Import
|
44 |
|
45 |
+
```python
|
46 |
+
from ctransformers import AutoModelForCausalLM
|
47 |
+
from transformers import pipeline, AutoModel, AutoTokenizer
|
48 |
+
from sentence_transformers import SentenceTransformer
|
49 |
+
import os
|
50 |
+
```
|
51 |
|
52 |
+
# Use a pipeline as a high-level helper
|
|
|
|
|
53 |
|
54 |
+
```python
|
55 |
|
56 |
+
# Load LLM and Tokenizer
|
57 |
|
58 |
+
# Load LLM and Tokenizer
|
59 |
|
60 |
+
model_llama = AutoModelForCausalLM.from_pretrained(
|
61 |
+
"alokabhishek/Llama-2-7b-chat-hf-GGUF",
|
62 |
+
model_file="llama-2-7b-chat-hf.Q4_K_M.gguf", # replace Q4_K_M.gguf with Q5_K_M.gguf as needed
|
63 |
+
model_type="llama",
|
64 |
+
gpu_layers=50, # Use `gpu_layers` to specify how many layers will be offloaded to the GPU.
|
65 |
+
hf=True
|
66 |
+
)
|
67 |
+
tokenizer_llama = AutoTokenizer.from_pretrained(
|
68 |
+
"alokabhishek/Llama-2-7b-chat-hf-GGUF",
|
69 |
+
use_fast=True
|
70 |
+
)
|
71 |
|
|
|
72 |
|
|
|
73 |
|
74 |
+
# Create a pipeline
|
75 |
+
pipe_llama = pipeline(model=model_llama, tokenizer=tokenizer_llama, task='text-generation')
|
76 |
|
77 |
+
prompt_llama = "Tell me a funny joke about Large Language Models meeting a Blackhole in an intergalactic Bar."
|
78 |
|
79 |
+
output_llama = pipe_llama(prompt_llama, max_new_tokens=512)
|
80 |
|
81 |
+
print(output_llama[0]["generated_text"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
```
|
84 |
|
85 |
+
## Uses
|
86 |
|
87 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
88 |
|
89 |
+
### Direct Use
|
90 |
|
91 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
92 |
|
93 |
[More Information Needed]
|
94 |
|
95 |
+
### Downstream Use [optional]
|
|
|
|
|
96 |
|
97 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
98 |
|
99 |
[More Information Needed]
|
100 |
|
101 |
+
### Out-of-Scope Use
|
|
|
|
|
102 |
|
103 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
104 |
|
105 |
[More Information Needed]
|
106 |
|
107 |
+
## Bias, Risks, and Limitations
|
108 |
|
109 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
[More Information Needed]
|
112 |
|
113 |
+
|
114 |
## Evaluation
|
115 |
|
116 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
|
|
139 |
|
140 |
[More Information Needed]
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
## Model Card Authors [optional]
|
144 |
|