MaxJeblick
commited on
Commit
•
a9262f5
1
Parent(s):
9ac0a41
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Small dummy LLama2-type Model useable for Unit/Integration tests.
|
2 |
+
Ensure that model input ids are < 100, see code below.
|
3 |
+
|
4 |
+
|
5 |
+
```python
|
6 |
+
from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM
|
7 |
+
|
8 |
+
repo_name = "MaxJeblick/llama2-0b-unit-test"
|
9 |
+
model_name = "h2oai/h2ogpt-4096-llama2-7b-chat"
|
10 |
+
config = AutoConfig.from_pretrained(model_name)
|
11 |
+
config.hidden_size = 12
|
12 |
+
config.max_position_embeddings = 32
|
13 |
+
config.intermediate_size = 24
|
14 |
+
config.num_attention_heads = 2
|
15 |
+
config.num_hidden_layers = 2
|
16 |
+
config.num_key_value_heads = 2
|
17 |
+
config.vocab_size = 100
|
18 |
+
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
+
|
21 |
+
|
22 |
+
model = AutoModelForCausalLM.from_config(config)
|
23 |
+
print(model.num_parameters()) # 5340
|
24 |
+
|
25 |
+
model.push_to_hub(repo_name, private=False)
|
26 |
+
tokenizer.push_to_hub(repo_name, private=False)
|
27 |
+
config.push_to_hub(repo_name, private=False)
|
28 |
+
```
|