Upload folder using huggingface_hub
Browse files- README.md +50 -0
- config.json +61 -70
- model.safetensors +2 -2
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- speculators
|
| 5 |
+
- hass
|
| 6 |
+
- eagle
|
| 7 |
+
- speculative-decoding
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# HASS Llama 3.1 8B with Layernorms
|
| 11 |
+
|
| 12 |
+
This is a converted HASS (Eagle variant with layernorms) speculator checkpoint for Llama 3.1 8B, compatible with the [speculators](https://github.com/neuralmagic/speculators) library.
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
|
| 16 |
+
- **Original checkpoint**: [nm-testing/Eagle_Speculator_Llama_3_1_8B_TTT](https://huggingface.co/nm-testing/Eagle_Speculator_Llama_3_1_8B_TTT)
|
| 17 |
+
- **Base model**: [meta-llama/Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct)
|
| 18 |
+
- **Architecture**: HASS (Eagle with layernorms enabled)
|
| 19 |
+
- **Size**: 961MB (larger due to additional layernorm weights)
|
| 20 |
+
|
| 21 |
+
## Usage
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
from speculators.models.eagle import EagleSpeculator
|
| 25 |
+
from transformers import AutoModelForCausalLM
|
| 26 |
+
|
| 27 |
+
# Load the HASS speculator
|
| 28 |
+
hass_model = EagleSpeculator.from_pretrained("nm-testing/hass-llama3.1-8b-layernorms")
|
| 29 |
+
|
| 30 |
+
# Attach verifier model
|
| 31 |
+
verifier = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3.1-8B-Instruct")
|
| 32 |
+
hass_model.attach_verifier(verifier)
|
| 33 |
+
|
| 34 |
+
# Use for speculative decoding
|
| 35 |
+
# ... your speculative decoding code here ...
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Conversion Details
|
| 39 |
+
|
| 40 |
+
This checkpoint was converted using:
|
| 41 |
+
```bash
|
| 42 |
+
speculators convert --eagle --layernorms \
|
| 43 |
+
nm-testing/Eagle_Speculator_Llama_3_1_8B_TTT \
|
| 44 |
+
./hass-layernorms-converted \
|
| 45 |
+
meta-llama/Meta-Llama-3.1-8B-Instruct
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## License
|
| 49 |
+
|
| 50 |
+
Apache 2.0
|
config.json
CHANGED
|
@@ -17,21 +17,12 @@
|
|
| 17 |
"name_or_path": "meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 18 |
"architectures": [
|
| 19 |
"LlamaForCausalLM"
|
| 20 |
-
],
|
| 21 |
-
"hidden_size": 4096,
|
| 22 |
-
"intermediate_size": 14336,
|
| 23 |
-
"vocab_size": 128256,
|
| 24 |
-
"max_position_embeddings": 131072,
|
| 25 |
-
"bos_token_id": 128000,
|
| 26 |
-
"eos_token_id": [
|
| 27 |
-
128001,
|
| 28 |
-
128008,
|
| 29 |
-
128009
|
| 30 |
]
|
| 31 |
}
|
| 32 |
},
|
| 33 |
"architectures": [
|
| 34 |
-
"EagleSpeculator"
|
|
|
|
| 35 |
],
|
| 36 |
"transformer_layer_architecture": "LlamaDecoderLayer",
|
| 37 |
"transformer_layer_config": {
|
|
@@ -59,76 +50,76 @@
|
|
| 59 |
"attention_dropout": 0.0,
|
| 60 |
"mlp_bias": false,
|
| 61 |
"head_dim": 128,
|
| 62 |
-
"return_dict": true,
|
| 63 |
-
"output_hidden_states": false,
|
| 64 |
-
"output_attentions": false,
|
| 65 |
-
"torchscript": false,
|
| 66 |
-
"torch_dtype": null,
|
| 67 |
-
"use_bfloat16": false,
|
| 68 |
-
"tf_legacy_loss": false,
|
| 69 |
-
"pruned_heads": {},
|
| 70 |
"tie_word_embeddings": false,
|
| 71 |
-
"chunk_size_feed_forward": 0,
|
| 72 |
-
"is_encoder_decoder": false,
|
| 73 |
-
"is_decoder": false,
|
| 74 |
-
"cross_attention_hidden_size": null,
|
| 75 |
-
"add_cross_attention": false,
|
| 76 |
-
"tie_encoder_decoder": false,
|
| 77 |
-
"max_length": 20,
|
| 78 |
-
"min_length": 0,
|
| 79 |
-
"do_sample": false,
|
| 80 |
-
"early_stopping": false,
|
| 81 |
-
"num_beams": 1,
|
| 82 |
-
"num_beam_groups": 1,
|
| 83 |
-
"diversity_penalty": 0.0,
|
| 84 |
-
"temperature": 1.0,
|
| 85 |
-
"top_k": 50,
|
| 86 |
-
"top_p": 1.0,
|
| 87 |
-
"typical_p": 1.0,
|
| 88 |
-
"repetition_penalty": 1.0,
|
| 89 |
-
"length_penalty": 1.0,
|
| 90 |
-
"no_repeat_ngram_size": 0,
|
| 91 |
-
"encoder_no_repeat_ngram_size": 0,
|
| 92 |
-
"bad_words_ids": null,
|
| 93 |
-
"num_return_sequences": 1,
|
| 94 |
-
"output_scores": false,
|
| 95 |
-
"return_dict_in_generate": false,
|
| 96 |
-
"forced_bos_token_id": null,
|
| 97 |
-
"forced_eos_token_id": null,
|
| 98 |
-
"remove_invalid_values": false,
|
| 99 |
-
"exponential_decay_length_penalty": null,
|
| 100 |
-
"suppress_tokens": null,
|
| 101 |
-
"begin_suppress_tokens": null,
|
| 102 |
-
"architectures": null,
|
| 103 |
-
"finetuning_task": null,
|
| 104 |
-
"id2label": {
|
| 105 |
-
"0": "LABEL_0",
|
| 106 |
-
"1": "LABEL_1"
|
| 107 |
-
},
|
| 108 |
-
"label2id": {
|
| 109 |
-
"LABEL_0": 0,
|
| 110 |
-
"LABEL_1": 1
|
| 111 |
-
},
|
| 112 |
-
"tokenizer_class": null,
|
| 113 |
-
"prefix": null,
|
| 114 |
"bos_token_id": 128000,
|
| 115 |
-
"pad_token_id": null,
|
| 116 |
"eos_token_id": [
|
| 117 |
128001,
|
| 118 |
128008,
|
| 119 |
128009
|
| 120 |
],
|
| 121 |
-
"sep_token_id": null,
|
| 122 |
-
"decoder_start_token_id": null,
|
| 123 |
-
"task_specific_params": null,
|
| 124 |
-
"problem_type": null,
|
| 125 |
-
"_name_or_path": "",
|
| 126 |
"transformers_version": "4.52.4",
|
| 127 |
"model_type": "llama"
|
| 128 |
},
|
| 129 |
"layernorms": true,
|
| 130 |
"fusion_bias": false,
|
| 131 |
"_name_or_path": "",
|
| 132 |
-
"
|
| 133 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
|
|
|
| 17 |
"name_or_path": "meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 18 |
"architectures": [
|
| 19 |
"LlamaForCausalLM"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
]
|
| 21 |
}
|
| 22 |
},
|
| 23 |
"architectures": [
|
| 24 |
+
"EagleSpeculator",
|
| 25 |
+
"LlamaDecoderLayer"
|
| 26 |
],
|
| 27 |
"transformer_layer_architecture": "LlamaDecoderLayer",
|
| 28 |
"transformer_layer_config": {
|
|
|
|
| 50 |
"attention_dropout": 0.0,
|
| 51 |
"mlp_bias": false,
|
| 52 |
"head_dim": 128,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
"tie_word_embeddings": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
"bos_token_id": 128000,
|
|
|
|
| 55 |
"eos_token_id": [
|
| 56 |
128001,
|
| 57 |
128008,
|
| 58 |
128009
|
| 59 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
"transformers_version": "4.52.4",
|
| 61 |
"model_type": "llama"
|
| 62 |
},
|
| 63 |
"layernorms": true,
|
| 64 |
"fusion_bias": false,
|
| 65 |
"_name_or_path": "",
|
| 66 |
+
"transformers_version": "4.52.4",
|
| 67 |
+
"return_dict": true,
|
| 68 |
+
"output_hidden_states": false,
|
| 69 |
+
"output_attentions": false,
|
| 70 |
+
"torchscript": false,
|
| 71 |
+
"torch_dtype": null,
|
| 72 |
+
"use_bfloat16": false,
|
| 73 |
+
"tf_legacy_loss": false,
|
| 74 |
+
"pruned_heads": {},
|
| 75 |
+
"tie_word_embeddings": true,
|
| 76 |
+
"chunk_size_feed_forward": 0,
|
| 77 |
+
"is_encoder_decoder": false,
|
| 78 |
+
"is_decoder": false,
|
| 79 |
+
"cross_attention_hidden_size": null,
|
| 80 |
+
"add_cross_attention": false,
|
| 81 |
+
"tie_encoder_decoder": false,
|
| 82 |
+
"max_length": 20,
|
| 83 |
+
"min_length": 0,
|
| 84 |
+
"do_sample": false,
|
| 85 |
+
"early_stopping": false,
|
| 86 |
+
"num_beams": 1,
|
| 87 |
+
"num_beam_groups": 1,
|
| 88 |
+
"diversity_penalty": 0.0,
|
| 89 |
+
"temperature": 1.0,
|
| 90 |
+
"top_k": 50,
|
| 91 |
+
"top_p": 1.0,
|
| 92 |
+
"typical_p": 1.0,
|
| 93 |
+
"repetition_penalty": 1.0,
|
| 94 |
+
"length_penalty": 1.0,
|
| 95 |
+
"no_repeat_ngram_size": 0,
|
| 96 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 97 |
+
"bad_words_ids": null,
|
| 98 |
+
"num_return_sequences": 1,
|
| 99 |
+
"output_scores": false,
|
| 100 |
+
"return_dict_in_generate": false,
|
| 101 |
+
"forced_bos_token_id": null,
|
| 102 |
+
"forced_eos_token_id": null,
|
| 103 |
+
"remove_invalid_values": false,
|
| 104 |
+
"exponential_decay_length_penalty": null,
|
| 105 |
+
"suppress_tokens": null,
|
| 106 |
+
"begin_suppress_tokens": null,
|
| 107 |
+
"finetuning_task": null,
|
| 108 |
+
"id2label": {
|
| 109 |
+
"0": "LABEL_0",
|
| 110 |
+
"1": "LABEL_1"
|
| 111 |
+
},
|
| 112 |
+
"label2id": {
|
| 113 |
+
"LABEL_0": 0,
|
| 114 |
+
"LABEL_1": 1
|
| 115 |
+
},
|
| 116 |
+
"tokenizer_class": null,
|
| 117 |
+
"prefix": null,
|
| 118 |
+
"bos_token_id": null,
|
| 119 |
+
"pad_token_id": null,
|
| 120 |
+
"eos_token_id": null,
|
| 121 |
+
"sep_token_id": null,
|
| 122 |
+
"decoder_start_token_id": null,
|
| 123 |
+
"task_specific_params": null,
|
| 124 |
+
"problem_type": null
|
| 125 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4151564cb2c9bc7f762af53d68a94e5924f60848992c1814128bafce576a8704
|
| 3 |
+
size 1006699768
|