iproskurina commited on
Commit
992242b
1 Parent(s): b9913af

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +57 -0
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mistralai/Mistral-7B-v0.1
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Mistral AI
6
+ model_name: Mistral 7B v0.1
7
+ model_type: mistral
8
+ pipeline_tag: text-generation
9
+ prompt_template: '{prompt}'
10
+ quantized_by: iproskurina
11
+ tags:
12
+ - pretrained
13
+ datasets:
14
+ - c4
15
+ ---
16
+
17
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/629a3dbcd496c6dcdebf41cc/RME9Zljn25hQSj8-y61oo.png)
18
+
19
+
20
+ # Mistral 7B v0.1 - GPTQ
21
+ - Model creator: [Mistral AI](https://huggingface.co/mistralai)
22
+ - Original model: [Mistral 7B v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
23
+
24
+ The model published in this repo was quantized to 4bit using [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ).
25
+
26
+ **Quantization details**
27
+
28
+ **All quantization parameters were taken from [GPTQ paper](https://arxiv.org/abs/2210.17323).**
29
+
30
+ GPTQ calibration data consisted of 128 random 2048 token segments from the [C4 dataset](https://huggingface.co/datasets/c4).
31
+
32
+ The grouping size used for quantization is equal to 128.
33
+
34
+ ## How to use this GPTQ model from Python code
35
+
36
+ ### Install the necessary packages
37
+
38
+ ```shell
39
+ pip install accelerate==0.26.1 datasets==2.16.1 dill==0.3.7 gekko==1.0.6 multiprocess==0.70.15 peft==0.7.1 rouge==1.0.1 sentencepiece==0.1.99
40
+ git clone https://github.com/upunaprosk/AutoGPTQ
41
+ cd AutoGPTQ
42
+ pip install -v .
43
+ ```
44
+ Recommended transformers version: 4.35.2.
45
+
46
+ ### You can then use the following code
47
+
48
+ ```python
49
+
50
+ from transformers import AutoTokenizer, TextGenerationPipeline,AutoModelForCausalLM
51
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
52
+ pretrained_model_dir = "iproskurina/Mistral-7B-gptq-4bit"
53
+ tokenizer = AutoTokenizer.from_pretrained(pretrained_model_dir, use_fast=True)
54
+ model = AutoGPTQForCausalLM.from_quantized(pretrained_model_dir, device="cuda:0", model_basename="model")
55
+ pipeline = TextGenerationPipeline(model=model, tokenizer=tokenizer)
56
+ print(pipeline("auto-gptq is")[0]["generated_text"])
57
+ ```