Duplicate openai-community/gpt2 for ANEForge (weights unchanged, library_name: aneforge)
Browse files- 64-8bits.tflite +3 -0
- 64-fp16.tflite +3 -0
- 64.tflite +3 -0
- README.md +29 -0
- config.json +31 -0
- generation_config.json +6 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
64-8bits.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c966da3b74697803352ca7c6f2f220e7090a557b619de9da0c6b34d89f7825c1
|
| 3 |
+
size 125162496
|
64-fp16.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ceafd82e733dd4b21570b2a86cf27556a983041806c033a55d086e0ed782cd3
|
| 3 |
+
size 248269688
|
64.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfcd510b239d90b71ee87d4e57a5a8c2d55b2a941e5d9fe5852298268ddbe61b
|
| 3 |
+
size 495791932
|
README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: aneforge
|
| 3 |
+
license: mit
|
| 4 |
+
base_model: openai-community/gpt2
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- aneforge
|
| 8 |
+
- apple-neural-engine
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# GPT-2 (ANEForge)
|
| 12 |
+
|
| 13 |
+
An unmodified duplicate of [`openai-community/gpt2`](https://huggingface.co/openai-community/gpt2), tagged for use with
|
| 14 |
+
[**ANEForge**](https://github.com/sbryngelson/ANEForge) so the weights load and run directly on the
|
| 15 |
+
Apple Neural Engine (no CoreML). Weights are byte-identical to the source; see the original repo for
|
| 16 |
+
the model details. Licensed `mit` from the source.
|
| 17 |
+
|
| 18 |
+
## Use with ANEForge
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
import aneforge as af
|
| 22 |
+
|
| 23 |
+
model = af.load_gpt2("aneforge/gpt2")
|
| 24 |
+
print(model.generate_text("The Apple Neural Engine is", max_new_tokens=20))
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
ANEForge compiles the model's graph into a single ANE program and streams the weights from this repo
|
| 28 |
+
via `huggingface_hub`. See the [docs](https://aneforge.readthedocs.io) and the
|
| 29 |
+
[paper](https://arxiv.org/abs/2606.17090).
|
config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT2LMHeadModel"
|
| 5 |
+
],
|
| 6 |
+
"attn_pdrop": 0.1,
|
| 7 |
+
"bos_token_id": 50256,
|
| 8 |
+
"embd_pdrop": 0.1,
|
| 9 |
+
"eos_token_id": 50256,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"layer_norm_epsilon": 1e-05,
|
| 12 |
+
"model_type": "gpt2",
|
| 13 |
+
"n_ctx": 1024,
|
| 14 |
+
"n_embd": 768,
|
| 15 |
+
"n_head": 12,
|
| 16 |
+
"n_layer": 12,
|
| 17 |
+
"n_positions": 1024,
|
| 18 |
+
"resid_pdrop": 0.1,
|
| 19 |
+
"summary_activation": null,
|
| 20 |
+
"summary_first_dropout": 0.1,
|
| 21 |
+
"summary_proj_to_labels": true,
|
| 22 |
+
"summary_type": "cls_index",
|
| 23 |
+
"summary_use_proj": true,
|
| 24 |
+
"task_specific_params": {
|
| 25 |
+
"text-generation": {
|
| 26 |
+
"do_sample": true,
|
| 27 |
+
"max_length": 50
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"vocab_size": 50257
|
| 31 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 50256,
|
| 3 |
+
"eos_token_id": 50256,
|
| 4 |
+
"transformers_version": "4.26.0.dev0",
|
| 5 |
+
"_from_model_config": true
|
| 6 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:248dfc3911869ec493c76e65bf2fcf7f615828b0254c12b473182f0f81d3a707
|
| 3 |
+
size 548105171
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"model_max_length": 1024}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|