michaelfeil commited on
Commit
0ffcca8
·
verified ·
1 Parent(s): 0e24490

Upload LlamaForSequenceClassification

Browse files
README.md CHANGED
@@ -1,81 +1,6 @@
1
  ---
2
  {}
3
  ---
4
-
5
- Deployment:
6
- ```yaml
7
- build_commands: []
8
- external_package_dirs: []
9
- model_metadata: {}
10
- model_name: fp8-baseten/example-Meta-Llama-3-70B-InstructForSequenceClassification
11
- python_version: py39
12
- requirements: []
13
- resources:
14
- accelerator: H100:1
15
- cpu: "1"
16
- memory: 64Gi
17
- use_gpu: true
18
- secrets:
19
- hf_access_token: set token in baseten workspace
20
- system_packages: []
21
- trt_llm:
22
- build:
23
- base_model: encoder
24
- # automatically infered from config[max_position_embeddings]
25
- max_seq_len: 42
26
- # max_batch_size per dynamic batch, recommended to stay at 32
27
- max_batch_size: 32
28
- # max num tokens per dynamic batch, strongly recommended to keep this number
29
- max_num_tokens: 16384
30
- checkpoint_repository:
31
- source: HF
32
- repo: "baseten/example-Meta-Llama-3-70B-InstructForSequenceClassification"
33
- revision: "main" # hf revision hash
34
- # `fp8` or `no_quant` (=fp16) are allowed.
35
- quantization_type: fp8
36
- num_builder_gpus: 4
37
- ```
38
-
39
- Usage:
40
- ```python
41
- import requests
42
- import os
43
- from transformers import AutoTokenizer
44
-
45
- tokenizer = AutoTokenizer.from_pretrained("Skywork/Skywork-Reward-Llama-3.1-8B-v0.2")
46
-
47
- prompt = "Jane has 12 apples. She gives 4 apples to her friend Mark, then buys 1 more apple, and finally splits all her apples equally among herself and her 2 siblings. How many apples does each person get?"
48
- # Positive example, gets high score 0.999 or raw around inv_sig(0.999) ~ 13
49
- response1 = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among herself and her 2 siblings (3 people in total). 9 ÷ 3 = 3 apples each. Each person gets 3 apples."
50
- # negative example, gets low score ~0.001 or raw around inv_sig(0.001) ~ -9
51
- response2 = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among her 2 siblings (2 people in total). 9 ÷ 2 = 4.5 apples each. Each person gets 4 apples."
52
-
53
- # predict api: {
54
- # "inputs": "What is Deep Learning?", # str, may be formatted with chat template.
55
- # "raw_scores": false, # with or without sigmoid activation
56
- # "truncate": false,
57
- # "truncation_direction": "right"
58
- # }
59
-
60
- for assistant_response in [response1, response2]:
61
- # Feel free to parallelize this, requests will be batched in the backend.
62
-
63
- conv = [{"role": "user", "content": prompt}, {"role": "assistant", "content": assistant_response}]
64
- conv_formatted = tokenizer.apply_chat_template(conv, tokenize=False)
65
- input_json = dict(inputs=conv_formatted, raw_scores=True)
66
- resp = requests.post(
67
- "https://model-xxxxxx.api.baseten.co/environments/production/sync/predict",
68
- headers={"Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}"},
69
- json=input_json,
70
- )
71
-
72
- print(resp.json())
73
- # prints
74
- # [{'score': 13.714337, 'label': 'LABEL_0'}]
75
- # [{'score': -9.353895, 'label': 'LABEL_0'}]
76
- ```
77
-
78
- Reproduce this model:
79
  ```python
80
  #!/usr/bin/env python
81
  import torch
@@ -141,4 +66,5 @@ def main():
141
 
142
  if __name__ == "__main__":
143
  main()
 
144
  ```
 
1
  ---
2
  {}
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ```python
5
  #!/usr/bin/env python
6
  import torch
 
66
 
67
  if __name__ == "__main__":
68
  main()
69
+
70
  ```
config.json CHANGED
@@ -30,7 +30,17 @@
30
  "16": "token activation 16",
31
  "17": "token activation 17",
32
  "18": "token activation 18",
33
- "19": "token activation 19"
 
 
 
 
 
 
 
 
 
 
34
  },
35
  "initializer_range": 0.02,
36
  "intermediate_size": 28672,
@@ -48,6 +58,16 @@
48
  "token activation 18": 18,
49
  "token activation 19": 19,
50
  "token activation 2": 2,
 
 
 
 
 
 
 
 
 
 
51
  "token activation 3": 3,
52
  "token activation 4": 4,
53
  "token activation 5": 5,
@@ -67,7 +87,7 @@
67
  "rope_scaling": null,
68
  "rope_theta": 500000.0,
69
  "tie_word_embeddings": false,
70
- "torch_dtype": "float32",
71
  "transformers_version": "4.48.2",
72
  "use_cache": true,
73
  "vocab_size": 128256
 
30
  "16": "token activation 16",
31
  "17": "token activation 17",
32
  "18": "token activation 18",
33
+ "19": "token activation 19",
34
+ "20": "token activation 20",
35
+ "21": "token activation 21",
36
+ "22": "token activation 22",
37
+ "23": "token activation 23",
38
+ "24": "token activation 24",
39
+ "25": "token activation 25",
40
+ "26": "token activation 26",
41
+ "27": "token activation 27",
42
+ "28": "token activation 28",
43
+ "29": "token activation 29"
44
  },
45
  "initializer_range": 0.02,
46
  "intermediate_size": 28672,
 
58
  "token activation 18": 18,
59
  "token activation 19": 19,
60
  "token activation 2": 2,
61
+ "token activation 20": 20,
62
+ "token activation 21": 21,
63
+ "token activation 22": 22,
64
+ "token activation 23": 23,
65
+ "token activation 24": 24,
66
+ "token activation 25": 25,
67
+ "token activation 26": 26,
68
+ "token activation 27": 27,
69
+ "token activation 28": 28,
70
+ "token activation 29": 29,
71
  "token activation 3": 3,
72
  "token activation 4": 4,
73
  "token activation 5": 5,
 
87
  "rope_scaling": null,
88
  "rope_theta": 500000.0,
89
  "tie_word_embeddings": false,
90
+ "torch_dtype": "float16",
91
  "transformers_version": "4.48.2",
92
  "use_cache": true,
93
  "vocab_size": 128256
model-00001-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8f84dbb46c2fc2f78992a78279241057cbee01f4a2c7862107b26752f86f45c
3
+ size 4584408792
model-00002-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3ade41755e8d71655772e811a743143c044ee2f1ccf0e602ce8fc67da3f2c9d
3
+ size 4664167352
model-00003-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56fd8d67967a65efa2000a0dbe0ecc7bad5434bc346d67c1a1832596195ab881
3
+ size 4999711672
model-00004-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d74902ba07911c70fa46400bf1a1e24816cc65bc5afda41c0b3def218c105fff
3
+ size 4966157008
model-00005-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8634d3a943568fe0c106bc22d8901afb9509b8b6c057648d6284dd5abffe3a7c
3
+ size 4664134384
model-00006-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55b168636d8f9f84df056577c08e5d03316db2a70a966bdb7bde6f68bca1c8ca
3
+ size 4664167384
model-00007-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e6435139bd4d7ec4c6852d995f647fdf893132d08a0514cef7f9d142e967bf0
3
+ size 4664167376
model-00008-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53756815d5e970262b2fd7af965a0fe3b09137fbba845b8d1c82e175735c59aa
3
+ size 4999711704
model-00009-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41cdae7b9a1f469497627d619e4d5a237ef389c01e08f94c122d6bc7d32a7552
3
+ size 4966157032
model-00010-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95198e3d3e67d3f8c281539581f55b673ebd5f9eb90d7f13fe94787c150d6223
3
+ size 4664134384
model-00011-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:415763e45ce15b1cfc0cb33e3a29746f99e857ffecdf5650512812a0c0b1dd1f
3
+ size 4664167384
model-00012-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d39ad02a3308b476d9e4ebd1be47274ef0e0a4782fedfd85397491b3c18d7cb5
3
+ size 4664167376
model-00013-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5af3d4dec2fbdf92c78c40d90a551c3da4fb6501db024edf29582aaea2fb587
3
+ size 4999711704
model-00014-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:437e3a13a5ab207843f71f20fbd082f8499a8fb30a2f3ade045300968ce2f630
3
+ size 4966157032
model-00015-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2762ccdb7c773b142e8f331bd8976aede4d58a07feb4d2a461726b82111863c
3
+ size 4664134384
model-00016-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a89afc78018963c6e1cd6e3a6da59e63ecb3873b532db00e469bf9082ad258c
3
+ size 4664167384
model-00017-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4cafe00e8c2b6bcc768027cbe21b244e9484ce64f26924a68fddd6b67d5ed45
3
+ size 4664167376
model-00018-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb93da72b81e28e1efab99ce559f5702b1b0e5f6bdda3620520a0532fcb60b35
3
+ size 4999711704
model-00019-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39c17a5baad2315d176eb29e98163ab51401b477bcddcb0768712f1b961b48ff
3
+ size 4966157032
model-00020-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82dfcd74c13a3e76dc1de81753535c264f8d5812d208ef5e623d40548327b1ea
3
+ size 4664134384
model-00021-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:917718d0eaf4b6b730003dba0f31d4ef8a55feb9c0d0293799bf9229eb71bf1e
3
+ size 4664167384
model-00022-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0db3bf37e00e10d0568ddf0b99e52d5dc2d889e6bf7bd669bab2e8c4989023c9
3
+ size 4664167376
model-00023-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cf4c7acc97b7d30cabc547064c1ea6d0e88b225d2ea91fbca1a6c470929d724
3
+ size 4999711704
model-00024-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:361afdd738c57f738fdbfcceaeba50df088262da09a7dfefda2694e9e806f4a7
3
+ size 4966157032
model-00025-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c9a1f3f739578baeaa97b606ca2f554cf94d6a653657434e16ac12ecbcf87a2
3
+ size 4664134384
model-00026-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73443a83887308dacdf9e64c974f942d8f5ceadfb2bdc0bb19dbde32374d472e
3
+ size 4664167384
model-00027-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42c61cc5b616bb5467fe1ac94b44ca54829f35da4c3ad6ecd86d569dbac9564e
3
+ size 4664167376
model-00028-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:879c7e76af40e2696cd1ce494869cbebd503b856b4a00e9792c0726061d638a7
3
+ size 4999711704
model-00029-of-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:575c972f0b23b69fd313855309b55fbac6d9eae5a9df90985b7ae75add1f3836
3
+ size 4966665120
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff