Upload folder using huggingface_hub
Browse files- README.md +21 -0
- config.json +45 -0
- generation_config.json +6 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- gpt2
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# gpt2 (Quantized)
|
| 7 |
+
|
| 8 |
+
## Description
|
| 9 |
+
This model is a quantized version of the original model `gpt2`. It has been quantized using int8_weight_only quantization with torchao.
|
| 10 |
+
|
| 11 |
+
## Quantization Details
|
| 12 |
+
- **Quantization Type**: int8_weight_only
|
| 13 |
+
- **Group Size**: None
|
| 14 |
+
|
| 15 |
+
## Usage
|
| 16 |
+
You can use this model in your applications by loading it directly from the Hugging Face Hub:
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
from transformers import AutoModel
|
| 20 |
+
|
| 21 |
+
model = AutoModel.from_pretrained("gpt2")
|
config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "gpt2",
|
| 3 |
+
"activation_function": "gelu_new",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 50256,
|
| 9 |
+
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 50256,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"layer_norm_epsilon": 1e-05,
|
| 13 |
+
"model_type": "gpt2",
|
| 14 |
+
"n_ctx": 1024,
|
| 15 |
+
"n_embd": 768,
|
| 16 |
+
"n_head": 12,
|
| 17 |
+
"n_inner": null,
|
| 18 |
+
"n_layer": 12,
|
| 19 |
+
"n_positions": 1024,
|
| 20 |
+
"quantization_config": {
|
| 21 |
+
"modules_to_not_convert": null,
|
| 22 |
+
"quant_method": "torchao",
|
| 23 |
+
"quant_type": "int8_weight_only",
|
| 24 |
+
"quant_type_kwargs": {}
|
| 25 |
+
},
|
| 26 |
+
"reorder_and_upcast_attn": false,
|
| 27 |
+
"resid_pdrop": 0.1,
|
| 28 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 29 |
+
"scale_attn_weights": true,
|
| 30 |
+
"summary_activation": null,
|
| 31 |
+
"summary_first_dropout": 0.1,
|
| 32 |
+
"summary_proj_to_labels": true,
|
| 33 |
+
"summary_type": "cls_index",
|
| 34 |
+
"summary_use_proj": true,
|
| 35 |
+
"task_specific_params": {
|
| 36 |
+
"text-generation": {
|
| 37 |
+
"do_sample": true,
|
| 38 |
+
"max_length": 50
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"torch_dtype": "bfloat16",
|
| 42 |
+
"transformers_version": "4.46.0.dev0",
|
| 43 |
+
"use_cache": true,
|
| 44 |
+
"vocab_size": 50257
|
| 45 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 50256,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"transformers_version": "4.46.0.dev0"
|
| 6 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:088f4ab871f22574ab8b7eed7ff3e0a8d235ddf76d430acdd5663bc399eda64a
|
| 3 |
+
size 248925978
|