ilu000 commited on
Commit
a038fb5
1 Parent(s): e6dc2f6

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ library_name: transformers
6
+ tags:
7
+ - gpt
8
+ - llm
9
+ - large language model
10
+ ---
11
+
12
+ ## Summary
13
+
14
+ h2o-danube2-1.8b-base is a foundation model trained by H2O.ai with 1.8 billion parameters. For details, please refer to our [Technical Report](https://arxiv.org/abs/2401.16818). We release three versions of this model:
15
+
16
+
17
+ | Model Name | Description |
18
+ |:-----------------------------------------------------------------------------------|:----------------|
19
+ | [h2oai/h2o-danube2-1.8b-base](https://huggingface.co/h2oai/h2o-danube2-1.8b-base) | Base model |
20
+ | [h2oai/h2o-danube2-1.8b-sft](https://huggingface.co/h2oai/h2o-danube2-1.8b-sft) | SFT tuned |
21
+ | [h2oai/h2o-danube2-1.8b-chat](https://huggingface.co/h2oai/h2o-danube2-1.8b-chat) | SFT + DPO tuned |
22
+
23
+
24
+ ## Model Architecture
25
+
26
+ We adjust the Llama 2 architecture for a total of around 1.8b parameters. We use the Mistral tokenizer with a vocabulary size of 32,000 and train our model up to a context length of 8,192.
27
+
28
+ The details of the model architecture are:
29
+
30
+ | Hyperparameter | Value |
31
+ |:----------------|:-------|
32
+ | n_layers | 24 |
33
+ | n_heads | 32 |
34
+ | n_query_groups | 8 |
35
+ | n_embd | 2560 |
36
+ | vocab size | 32000 |
37
+ | sequence length | 8192 |
38
+
39
+ ## Usage
40
+
41
+ This is a pre-trained foundation model. For your task, you will likely want to perform application specific fine-tuning. We also offer a chat fine-tuned version: [h2oai/h2o-danube2-1.8b-chat](https://huggingface.co/h2oai/h2o-danube2-1.8b-chat).
42
+
43
+ To use the model with the transformers library on a machine with GPUs, first make sure you have the transformers library installed.
44
+
45
+ ```python
46
+ # pip install transformers>=4.39.3
47
+
48
+ import torch
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained("h2oai/h2o-danube2-1.8b-base")
52
+
53
+ model = AutoModelForCausalLM.from_pretrained(
54
+ "h2oai/h2o-danube2-1.8b-base",
55
+ torch_dtype=torch.bfloat16,
56
+ )
57
+ model.cuda()
58
+
59
+ inputs = tokenizer("The Danube is the second longest river in Europe", return_tensors="pt").to(model.device)
60
+ res = model.generate(
61
+ **inputs,
62
+ max_new_tokens=38,
63
+ do_sample=False,
64
+ )
65
+ print(tokenizer.decode(res[0], skip_special_tokens=True))
66
+ ```
67
+
68
+ ## Benchmarks
69
+
70
+ Among models of similar size h2o-danube2-1.8b-base achieves best results (on average) across benchmarks of Open LLM Leaderboard 🤗
71
+
72
+
73
+ | Model | Size | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8k | Average |
74
+ |-------------------------------------------|-----------------|-----------|------|------------|-------|-------|-------|------|
75
+ | StableLM2-1.6B | 1.6B | 43.34 | 70.45| 38.95 | 36.78 | 64.56 | 17.44 | 45.25 |
76
+ | Gemma-2B | 2.5B | 48.46 | 71.65 | 41.68 | 33.13 | 66.77 | 17.36 | 46.51 |
77
+ | Qwen1.5-1.8B | 1.8B | 37.88 | 61.42 | **46.71** | 39.43 | 60.30 | **33.59** | 46.55 |
78
+ | Phi-1.5 | 1.3B | **52.90** | 63.79 | 43.89 | **40.89** | **72.22** | 12.43 | 47.69 |
79
+ | H2O-Danube2 | 1.8B | 43.52 | **73.06** | 40.05 | 38.09 | 68.43 | 29.34 | **48.75** |
80
+
81
+
82
+ ## Disclaimer
83
+
84
+ Please read this disclaimer carefully before using the large language model provided in this repository. Your use of the model signifies your agreement to the following terms and conditions.
85
+
86
+ - Biases and Offensiveness: The large language model is trained on a diverse range of internet text data, which may contain biased, racist, offensive, or otherwise inappropriate content. By using this model, you acknowledge and accept that the generated content may sometimes exhibit biases or produce content that is offensive or inappropriate. The developers of this repository do not endorse, support, or promote any such content or viewpoints.
87
+ - Limitations: The large language model is an AI-based tool and not a human. It may produce incorrect, nonsensical, or irrelevant responses. It is the user's responsibility to critically evaluate the generated content and use it at their discretion.
88
+ - Use at Your Own Risk: Users of this large language model must assume full responsibility for any consequences that may arise from their use of the tool. The developers and contributors of this repository shall not be held liable for any damages, losses, or harm resulting from the use or misuse of the provided model.
89
+ - Ethical Considerations: Users are encouraged to use the large language model responsibly and ethically. By using this model, you agree not to use it for purposes that promote hate speech, discrimination, harassment, or any form of illegal or harmful activities.
90
+ - Reporting Issues: If you encounter any biased, offensive, or otherwise inappropriate content generated by the large language model, please report it to the repository maintainers through the provided channels. Your feedback will help improve the model and mitigate potential issues.
91
+ - Changes to this Disclaimer: The developers of this repository reserve the right to modify or update this disclaimer at any time without prior notice. It is the user's responsibility to periodically review the disclaimer to stay informed about any changes.
92
+
93
+ By using the large language model provided in this repository, you agree to accept and comply with the terms and conditions outlined in this disclaimer. If you do not agree with any part of this disclaimer, you should refrain from using the model and any content generated by it.
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "h2o-foundation/h2o-danube2-1.8b-base",
3
+ "architectures": [
4
+ "MistralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2560,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 6912,
13
+ "max_position_embeddings": 8192,
14
+ "model_type": "mistral",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 24,
17
+ "num_key_value_heads": 8,
18
+ "rms_norm_eps": 1e-05,
19
+ "rope_theta": 10000,
20
+ "sliding_window": null,
21
+ "tie_word_embeddings": false,
22
+ "torch_dtype": "bfloat16",
23
+ "transformers_version": "4.39.3",
24
+ "use_cache": true,
25
+ "vocab_size": 32000
26
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.39.3"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:078aa7eaf712d61019cd9b4246a1dee4d0237da1b850ca3422a6930a42982421
3
+ size 3662427808
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ }
29
+ },
30
+ "additional_special_tokens": [],
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "legacy": true,
35
+ "model_max_length": 1000000000000000019884624838656,
36
+ "pad_token": null,
37
+ "sp_model_kwargs": {},
38
+ "spaces_between_special_tokens": false,
39
+ "tokenizer_class": "LlamaTokenizer",
40
+ "unk_token": "<unk>",
41
+ "use_default_system_prompt": false
42
+ }