SteveTran commited on
Commit
af3607c
·
verified ·
1 Parent(s): c4321fb

upload-4-bit

Browse files
.ipynb_checkpoints/config-checkpoint.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "../sample_models/ArmoRM-llama3/",
3
+ "architectures": [
4
+ "LlamaForRewardModelWithGating"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "auto_map": {
9
+ "AutoModelForSequenceClassification": "modeling_custom.LlamaForRewardModelWithGating"
10
+ },
11
+ "bos_token_id": 128000,
12
+ "eos_token_id": 128001,
13
+ "gating_hidden_dim": 1024,
14
+ "gating_n_hidden": 3,
15
+ "gating_temperature": 10,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 4096,
18
+ "id2label": {
19
+ "0": "LABEL_0"
20
+ },
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 14336,
23
+ "label2id": {
24
+ "LABEL_0": 0
25
+ },
26
+ "max_position_embeddings": 8192,
27
+ "model_type": "llama",
28
+ "num_attention_heads": 32,
29
+ "num_hidden_layers": 32,
30
+ "num_key_value_heads": 8,
31
+ "num_objectives": 19,
32
+ "pad_token_id": 128256,
33
+ "pretraining_tp": 1,
34
+ "quantization_config": {
35
+ "_load_in_4bit": true,
36
+ "_load_in_8bit": false,
37
+ "bnb_4bit_compute_dtype": "bfloat16",
38
+ "bnb_4bit_quant_storage": "uint8",
39
+ "bnb_4bit_quant_type": "nf4",
40
+ "bnb_4bit_use_double_quant": true,
41
+ "llm_int8_enable_fp32_cpu_offload": false,
42
+ "llm_int8_has_fp16_weight": false,
43
+ "llm_int8_skip_modules": null,
44
+ "llm_int8_threshold": 6.0,
45
+ "load_in_4bit": true,
46
+ "load_in_8bit": false,
47
+ "quant_method": "bitsandbytes"
48
+ },
49
+ "rms_norm_eps": 1e-05,
50
+ "rope_scaling": null,
51
+ "rope_theta": 500000.0,
52
+ "tie_word_embeddings": false,
53
+ "torch_dtype": "bfloat16",
54
+ "transformers_version": "4.40.2",
55
+ "use_cache": false,
56
+ "vocab_size": 128257
57
+ }
README.md CHANGED
@@ -35,24 +35,12 @@ license: llama3
35
  ## Demo Code
36
  ```python
37
  import torch
38
- from transformers import AutoConfig, AutoModelForSequenceClassification
39
- from transformers import BitsAndBytesConfig
40
- from transformers import AutoTokenizer, pipeline
41
-
42
  device = "cuda"
43
- path = "SteveTran/ArmoRM-Llama3-8B-v0.1-4bit"
 
 
44
  tokenizer = AutoTokenizer.from_pretrained(path, use_fast=True)
45
- bnb_quantization_config = BitsAndBytesConfig(load_in_4bit=True,
46
- bnb_4bit_compute_dtype=torch.bfloat16,
47
- bnb_4bit_quant_type="fp4",
48
- bnb_4bit_use_double_quant=True)
49
- model = AutoModelForSequenceClassification.from_pretrained(
50
- new_weights_location,
51
- quantization_config=bnb_quantization_config,
52
- device_map="auto",
53
- torch_dtype=torch.bfloat16,
54
- trust_remote_code=True,
55
- )
56
  # We load a random sample from the validation set of the HelpSteer dataset
57
  prompt = 'What are some synonyms for the word "beautiful"?'
58
  response = "Nicely, Beautifully, Handsome, Stunning, Wonderful, Gorgeous, Pretty, Stunning, Elegant"
 
35
  ## Demo Code
36
  ```python
37
  import torch
38
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
 
 
 
39
  device = "cuda"
40
+ path = "RLHFlow/ArmoRM-Llama3-8B-v0.1"
41
+ model = AutoModelForSequenceClassification.from_pretrained(path, device_map=device,
42
+ trust_remote_code=True, torch_dtype=torch.bfloat16)
43
  tokenizer = AutoTokenizer.from_pretrained(path, use_fast=True)
 
 
 
 
 
 
 
 
 
 
 
44
  # We load a random sample from the validation set of the HelpSteer dataset
45
  prompt = 'What are some synonyms for the word "beautiful"?'
46
  response = "Nicely, Beautifully, Handsome, Stunning, Wonderful, Gorgeous, Pretty, Stunning, Elegant"
config.json CHANGED
@@ -36,7 +36,7 @@
36
  "_load_in_8bit": false,
37
  "bnb_4bit_compute_dtype": "bfloat16",
38
  "bnb_4bit_quant_storage": "uint8",
39
- "bnb_4bit_quant_type": "fp4",
40
  "bnb_4bit_use_double_quant": true,
41
  "llm_int8_enable_fp32_cpu_offload": false,
42
  "llm_int8_has_fp16_weight": false,
 
36
  "_load_in_8bit": false,
37
  "bnb_4bit_compute_dtype": "bfloat16",
38
  "bnb_4bit_quant_storage": "uint8",
39
+ "bnb_4bit_quant_type": "nf4",
40
  "bnb_4bit_use_double_quant": true,
41
  "llm_int8_enable_fp32_cpu_offload": false,
42
  "llm_int8_has_fp16_weight": false,
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7002cddb2ab8d0f289596cc337c78b5f4c482b0e31229f88ff4efee8762c9f13
3
- size 2985501395
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2d30bb5db48afcb66c8663120ddf2097610c5c5494063a7bedab000991ba6e9
3
+ size 2985566107
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:42b4ca78d243ecb3c5917ec35ca07b3256e70ddf1baa79096f37fe74b2efcfb6
3
- size 1669796944
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e5aa6b7fbc4a6d786894f52b8304a09e6f0fe4000dd92065672bff7897be56c
3
+ size 1669853624
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff