matbee commited on
Commit
268b2f7
·
verified ·
1 Parent(s): 19b6ba2

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  base/tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  base/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .cache/
README.md CHANGED
@@ -75,11 +75,11 @@ The ~5% per-prompt embedding cosine drift (0.953 mean vs bf16) propagates into ~
75
 
76
  ```
77
  .
78
- ├── base/ # bnb-quantized Llama-3-8B + merged MNTP
79
- ├── config.json # contains quantization_config (auto-applied on load)
80
- ├── model.safetensors # bnb 4-bit weights
81
- ├── tokenizer.json
82
- │ └── tokenizer_config.json
83
  ├── supervised_adapter/ # second LoRA stack (kept un-merged)
84
  │ ├── adapter_config.json
85
  │ └── adapter_model.safetensors
@@ -99,12 +99,12 @@ CUDA_VISIBLE_DEVICES=0 \
99
  TEXT_ENCODER_DEVICE=cuda:0 \
100
  TEXT_ENCODER_MODE=local \
101
  LLM2VEC_QUANTIZE=nf4 \
102
- LLM2VEC_LOCAL_BASE=$HOME/llm2vec-nf4/base \
103
  LLM2VEC_LOCAL_PEFT=$HOME/llm2vec-nf4/supervised_adapter \
104
  python kimodo_daemon.py
105
  ```
106
 
107
- `LLM2VEC_QUANTIZE=nf4` tells the wrapper to honor the bnb config in `base/config.json`. The two `LLM2VEC_LOCAL_*` vars short-circuit the Hub download.
108
 
109
  ## Standalone use (without kimodo)
110
 
@@ -118,7 +118,7 @@ from llm2vec import LLM2Vec # from McGill's llm2vec package
118
 
119
  # Load the bnb-quantized base; quantization_config is in config.json so
120
  # transformers re-applies bnb automatically.
121
- base_dir = "<local clone>/base"
122
  adapter_dir = "<local clone>/supervised_adapter"
123
 
124
  model = LLM2Vec.from_pretrained(
 
75
 
76
  ```
77
  .
78
+ ├── config.json # contains quantization_config (auto-applied on load)
79
+ ├── model.safetensors # bnb 4-bit weights (Llama-3-8B + merged MNTP)
80
+ ├── tokenizer.json
81
+ ├── tokenizer_config.json
82
+ ── chat_template.jinja
83
  ├── supervised_adapter/ # second LoRA stack (kept un-merged)
84
  │ ├── adapter_config.json
85
  │ └── adapter_model.safetensors
 
99
  TEXT_ENCODER_DEVICE=cuda:0 \
100
  TEXT_ENCODER_MODE=local \
101
  LLM2VEC_QUANTIZE=nf4 \
102
+ LLM2VEC_LOCAL_BASE=$HOME/llm2vec-nf4 \
103
  LLM2VEC_LOCAL_PEFT=$HOME/llm2vec-nf4/supervised_adapter \
104
  python kimodo_daemon.py
105
  ```
106
 
107
+ `LLM2VEC_QUANTIZE=nf4` tells the wrapper to honor the bnb config in `config.json`. The two `LLM2VEC_LOCAL_*` vars short-circuit the Hub download.
108
 
109
  ## Standalone use (without kimodo)
110
 
 
118
 
119
  # Load the bnb-quantized base; quantization_config is in config.json so
120
  # transformers re-applies bnb automatically.
121
+ base_dir = "<local clone>"
122
  adapter_dir = "<local clone>/supervised_adapter"
123
 
124
  model = LLM2Vec.from_pretrained(
chat_template.jinja ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>
2
+
3
+ '+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
4
+
5
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaBiModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 128000,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 128009,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 4096,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 14336,
15
+ "max_position_embeddings": 8192,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 32,
20
+ "num_key_value_heads": 8,
21
+ "pad_token_id": null,
22
+ "pretraining_tp": 1,
23
+ "quantization_config": {
24
+ "_load_in_4bit": true,
25
+ "_load_in_8bit": false,
26
+ "bnb_4bit_compute_dtype": "bfloat16",
27
+ "bnb_4bit_quant_storage": "uint8",
28
+ "bnb_4bit_quant_type": "nf4",
29
+ "bnb_4bit_use_double_quant": true,
30
+ "llm_int8_enable_fp32_cpu_offload": false,
31
+ "llm_int8_has_fp16_weight": false,
32
+ "llm_int8_skip_modules": null,
33
+ "llm_int8_threshold": 6.0,
34
+ "load_in_4bit": true,
35
+ "load_in_8bit": false,
36
+ "quant_method": "bitsandbytes"
37
+ },
38
+ "rms_norm_eps": 1e-05,
39
+ "rope_parameters": {
40
+ "rope_theta": 500000.0,
41
+ "rope_type": "default"
42
+ },
43
+ "tie_word_embeddings": false,
44
+ "transformers_version": "5.1.0",
45
+ "use_cache": true,
46
+ "vocab_size": 128256
47
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64d4bea7b029f5ea40c52eb84c11cb370ddb4d7d45f4e9f8d3babe92e3665c5d
3
+ size 4652064697
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c5cf44023714fb39b05e71e425f8d7b92805ff73f7988b083b8c87f0bf87393
3
+ size 17209961
tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": true,
7
+ "model_input_names": [
8
+ "input_ids",
9
+ "attention_mask"
10
+ ],
11
+ "model_max_length": 1000000000000000019884624838656,
12
+ "tokenizer_class": "TokenizersBackend"
13
+ }