commit files to HF hub
Browse files- README.md +25 -0
- config.json +33 -0
- inference.py +10 -0
- merges.txt +0 -0
- openvino_model.bin +3 -0
- openvino_model.xml +0 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +30 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- openvino
|
6 |
+
---
|
7 |
+
|
8 |
+
# facebook/opt-13b
|
9 |
+
|
10 |
+
This is the [facebook/opt-13b](https://huggingface.co/facebook/opt-13b) model converted to [OpenVINO](https://openvino.ai) with INT8 weights compression for accelerated inference.
|
11 |
+
|
12 |
+
An example of how to do inference on this model:
|
13 |
+
```python
|
14 |
+
from optimum.intel import OVModelForCausalLM
|
15 |
+
from transformers import AutoTokenizer, pipeline
|
16 |
+
|
17 |
+
# model_id should be set to either a local directory or a model available on the HuggingFace hub.
|
18 |
+
model_id = "helenai/facebook-opt-13b-ov"
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
20 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
21 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
22 |
+
result = pipe("hello world")
|
23 |
+
print(result)
|
24 |
+
```
|
25 |
+
|
config.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "facebook/opt-13b",
|
3 |
+
"_remove_final_layer_norm": false,
|
4 |
+
"activation_dropout": 0.0,
|
5 |
+
"activation_function": "relu",
|
6 |
+
"architectures": [
|
7 |
+
"OPTForCausalLM"
|
8 |
+
],
|
9 |
+
"attention_dropout": 0.0,
|
10 |
+
"bos_token_id": 2,
|
11 |
+
"do_layer_norm_before": true,
|
12 |
+
"dropout": 0.1,
|
13 |
+
"enable_bias": true,
|
14 |
+
"eos_token_id": 2,
|
15 |
+
"ffn_dim": 20480,
|
16 |
+
"hidden_size": 5120,
|
17 |
+
"init_std": 0.02,
|
18 |
+
"is_decoder": true,
|
19 |
+
"layer_norm_elementwise_affine": true,
|
20 |
+
"layerdrop": 0.0,
|
21 |
+
"max_position_embeddings": 2048,
|
22 |
+
"model_type": "opt",
|
23 |
+
"num_attention_heads": 40,
|
24 |
+
"num_hidden_layers": 40,
|
25 |
+
"output_projection": true,
|
26 |
+
"pad_token_id": 1,
|
27 |
+
"prefix": "</s>",
|
28 |
+
"torch_dtype": "float16",
|
29 |
+
"transformers_version": "4.39.0",
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 50272,
|
32 |
+
"word_embed_proj_dim": 5120
|
33 |
+
}
|
inference.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from optimum.intel import OVModelForCausalLM
|
2 |
+
from transformers import AutoTokenizer, pipeline
|
3 |
+
|
4 |
+
# model_id should be set to either a local directory or a model available on the HuggingFace hub.
|
5 |
+
model_id = "helenai/facebook-opt-13b-ov"
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
7 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
8 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
9 |
+
result = pipe("hello world")
|
10 |
+
print(result)
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openvino_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ac4979f37e70bb24bc09b02ebdce34b8b22ed82f9b55e62d123d5b5d5f60b4b
|
3 |
+
size 12865519046
|
openvino_model.xml
ADDED
The diff for this file is too large to render.
See raw diff
|
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "</s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<pad>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": true,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "</s>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": true,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_prefix_space": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"1": {
|
6 |
+
"content": "<pad>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"2": {
|
14 |
+
"content": "</s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
}
|
21 |
+
},
|
22 |
+
"bos_token": "</s>",
|
23 |
+
"clean_up_tokenization_spaces": true,
|
24 |
+
"eos_token": "</s>",
|
25 |
+
"errors": "replace",
|
26 |
+
"model_max_length": 1000000000000000019884624838656,
|
27 |
+
"pad_token": "<pad>",
|
28 |
+
"tokenizer_class": "GPT2Tokenizer",
|
29 |
+
"unk_token": "</s>"
|
30 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|