Update README.md
Browse files
README.md
CHANGED
@@ -159,38 +159,40 @@ It is strongly recommended to use the text-generation-webui one-click-installers
|
|
159 |
|
160 |
### Install the necessary packages
|
161 |
|
162 |
-
Requires: Transformers 4.
|
163 |
|
164 |
```shell
|
165 |
-
pip3 install transformers>=4.
|
166 |
-
pip3
|
|
|
|
|
|
|
167 |
```
|
168 |
|
169 |
-
|
|
|
|
|
170 |
|
171 |
```shell
|
172 |
-
|
173 |
-
|
174 |
-
cd AutoGPTQ
|
175 |
-
pip3 install .
|
176 |
```
|
177 |
|
178 |
-
###
|
179 |
|
180 |
-
If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
|
181 |
```shell
|
182 |
-
|
183 |
-
|
|
|
184 |
```
|
185 |
|
186 |
-
###
|
187 |
|
188 |
```python
|
189 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
190 |
|
191 |
-
model_name_or_path = "
|
192 |
-
|
193 |
-
# For example: revision="gptq-3bit--1g-actorder_True"
|
194 |
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
195 |
device_map="auto",
|
196 |
revision="main")
|
@@ -199,9 +201,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
|
199 |
|
200 |
prompt = "Tell me about AI"
|
201 |
prompt_template=f'''User: {prompt}
|
202 |
-
Assistant:
|
203 |
-
|
204 |
-
'''
|
205 |
|
206 |
print("\n\n*** Generate:")
|
207 |
|
@@ -229,9 +229,9 @@ print(pipe(prompt_template)[0]['generated_text'])
|
|
229 |
<!-- README_GPTQ.md-compatibility start -->
|
230 |
## Compatibility
|
231 |
|
232 |
-
The files
|
233 |
|
234 |
-
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models, but hasn't yet been tested with these files.
|
235 |
<!-- README_GPTQ.md-compatibility end -->
|
236 |
|
237 |
<!-- footer start -->
|
|
|
159 |
|
160 |
### Install the necessary packages
|
161 |
|
162 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ compiled from source with a patch.
|
163 |
|
164 |
```shell
|
165 |
+
pip3 install transformers>=4.33.0 optimum>=1.12.0
|
166 |
+
pip3 uninstall -y auto-gptq
|
167 |
+
git clone -b TB_Latest_Falcon https://github.com/TheBloke/AutoGPTQ
|
168 |
+
cd AutoGPTQ
|
169 |
+
pip3 install .
|
170 |
```
|
171 |
|
172 |
+
### You then need to manually download the repo so it can be merged
|
173 |
+
|
174 |
+
I recommend using my fast download script
|
175 |
|
176 |
```shell
|
177 |
+
git clone https://github.com/TheBlokeAI/AIScripts
|
178 |
+
python3 AIScripts/hub_download.py TheBloke/Falcon-180B-Chat-GPTQ Falcon-180B-Chat-GPTQ --branch main # change branch if you want to use the 3-bit model instead
|
|
|
|
|
179 |
```
|
180 |
|
181 |
+
### Now join the files
|
182 |
|
|
|
183 |
```shell
|
184 |
+
cd Falcon-180B-Chat-GPTQ
|
185 |
+
# Windows users: see the command to use in the Description at the top of this README
|
186 |
+
cat model.safetensors-split-* > model.safetensors && rm model.safetensors-split-*
|
187 |
```
|
188 |
|
189 |
+
### And then finally you can run the following code
|
190 |
|
191 |
```python
|
192 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
193 |
|
194 |
+
model_name_or_path = "/path/to/Falcon-180B-Chat-GPTQ" # change this to the path you downloaded the model to
|
195 |
+
|
|
|
196 |
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
197 |
device_map="auto",
|
198 |
revision="main")
|
|
|
201 |
|
202 |
prompt = "Tell me about AI"
|
203 |
prompt_template=f'''User: {prompt}
|
204 |
+
Assistant: '''
|
|
|
|
|
205 |
|
206 |
print("\n\n*** Generate:")
|
207 |
|
|
|
229 |
<!-- README_GPTQ.md-compatibility start -->
|
230 |
## Compatibility
|
231 |
|
232 |
+
The provided files have not yet been tested. They are expected to work with AutoGPTQ, or via Transformers, as long as Transformers 4.33.0 is installed, and AutoGPTQ is updated as described above.
|
233 |
|
234 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models, but hasn't yet been tested with these files. Let me know if it works!
|
235 |
<!-- README_GPTQ.md-compatibility end -->
|
236 |
|
237 |
<!-- footer start -->
|