arnocandel commited on
Commit
727ff8a
1 Parent(s): f602477

commit files to HF hub

Browse files
Files changed (1) hide show
  1. README.md +159 -0
README.md CHANGED
@@ -1,3 +1,162 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ inference: false
7
+ thumbnail: https://h2o.ai/etc.clientlibs/h2o/clientlibs/clientlib-site/resources/images/favicon.ico
8
+ tags:
9
+ - gpt
10
+ - llm
11
+ - large language model
12
+ - open-source
13
+ datasets:
14
+ - h2oai/h2ogpt-oig-oasst1-instruct-cleaned-v3
15
  ---
16
+ # h2oGPT Model Card
17
+ ## Summary
18
+
19
+ H2O.ai's `h2ogpt-oig-oasst1-falcon-40b` is a 40 billion parameter instruction-following large language model licensed for commercial use.
20
+
21
+ - Base model: [tiiuae/falcon-40b](https://huggingface.co/tiiuae/falcon-40b)
22
+ - Fine-tuning dataset: [h2oai/h2ogpt-oig-oasst1-instruct-cleaned-v3](https://huggingface.co/datasets/h2oai/h2ogpt-oig-oasst1-instruct-cleaned-v3)
23
+ - Data-prep and fine-tuning code: [H2O.ai GitHub](https://github.com/h2oai/h2ogpt)
24
+ - Training logs: [zip](https://huggingface.co/h2oai/h2ogpt-oig-oasst1-falcon-40b/blob/main/falcon-40b.h2oaih2ogpt-oig-oasst1-instruct-cleaned-v3.3_epochs.2e023709e9a36283986d136e66cb94e0bd7e6452.10.zip)
25
+
26
+ ## Chatbot
27
+
28
+ - Run your own chatbot: [H2O.ai GitHub](https://github.com/h2oai/h2ogpt)
29
+ [![H2O.ai GitHub](https://user-images.githubusercontent.com/6147661/232930822-e7170e4d-8aa1-4f7a-ad70-ece9cdd8b0cb.png)](https://github.com/h2oai/h2ogpt)
30
+
31
+ ## Usage
32
+
33
+ To use the model with the `transformers` library on a machine with GPUs, first make sure you have the following libraries installed.
34
+
35
+ ```bash
36
+ pip install transformers==4.29.2
37
+ pip install accelerate==0.19.0
38
+ pip install torch==2.0.1
39
+ pip install einops==0.6.1
40
+ ```
41
+
42
+ ```python
43
+ import torch
44
+ from transformers import pipeline
45
+
46
+ generate_text = pipeline(model="h2oai/h2ogpt-oig-oasst1-falcon-40b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
47
+
48
+ res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
49
+ print(res[0]["generated_text"])
50
+ ```
51
+
52
+ Alternatively, if you prefer to not use `trust_remote_code=True` you can download [instruct_pipeline.py](https://huggingface.co/h2oai/h2ogpt-oig-oasst1-falcon-40b/blob/main/h2oai_pipeline.py),
53
+ store it alongside your notebook, and construct the pipeline yourself from the loaded model and tokenizer:
54
+
55
+ ```python
56
+ import torch
57
+ from h2oai_pipeline import H2OTextGenerationPipeline
58
+ from transformers import AutoModelForCausalLM, AutoTokenizer
59
+
60
+ tokenizer = AutoTokenizer.from_pretrained("h2oai/h2ogpt-oig-oasst1-falcon-40b", padding_side="left")
61
+ model = AutoModelForCausalLM.from_pretrained("h2oai/h2ogpt-oig-oasst1-falcon-40b", torch_dtype=torch.bfloat16, device_map="auto")
62
+ generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
63
+
64
+ res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
65
+ print(res[0]["generated_text"])
66
+ ```
67
+
68
+ ## Model Architecture
69
+
70
+ ```
71
+ RWForCausalLM(
72
+ (transformer): RWModel(
73
+ (word_embeddings): Embedding(65024, 8192)
74
+ (h): ModuleList(
75
+ (0-59): 60 x DecoderLayer(
76
+ (ln_attn): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
77
+ (ln_mlp): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
78
+ (self_attention): Attention(
79
+ (maybe_rotary): RotaryEmbedding()
80
+ (query_key_value): Linear(in_features=8192, out_features=9216, bias=False)
81
+ (dense): Linear(in_features=8192, out_features=8192, bias=False)
82
+ (attention_dropout): Dropout(p=0.0, inplace=False)
83
+ )
84
+ (mlp): MLP(
85
+ (dense_h_to_4h): Linear(in_features=8192, out_features=32768, bias=False)
86
+ (act): GELU(approximate='none')
87
+ (dense_4h_to_h): Linear(in_features=32768, out_features=8192, bias=False)
88
+ )
89
+ )
90
+ )
91
+ (ln_f): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
92
+ )
93
+ (lm_head): Linear(in_features=8192, out_features=65024, bias=False)
94
+ )
95
+ ```
96
+
97
+ ## Model Configuration
98
+
99
+ ```json
100
+ RWConfig {
101
+ "_name_or_path": "h2oai/h2ogpt-oig-oasst1-falcon-40b",
102
+ "alibi": false,
103
+ "apply_residual_connection_post_layernorm": false,
104
+ "architectures": [
105
+ "RWForCausalLM"
106
+ ],
107
+ "attention_dropout": 0.0,
108
+ "auto_map": {
109
+ "AutoConfig": "tiiuae/falcon-40b--configuration_RW.RWConfig",
110
+ "AutoModel": "tiiuae/falcon-40b--modelling_RW.RWModel",
111
+ "AutoModelForCausalLM": "tiiuae/falcon-40b--modelling_RW.RWForCausalLM",
112
+ "AutoModelForQuestionAnswering": "tiiuae/falcon-40b--modelling_RW.RWForQuestionAnswering",
113
+ "AutoModelForSequenceClassification": "tiiuae/falcon-40b--modelling_RW.RWForSequenceClassification",
114
+ "AutoModelForTokenClassification": "tiiuae/falcon-40b--modelling_RW.RWForTokenClassification"
115
+ },
116
+ "bias": false,
117
+ "bos_token_id": 11,
118
+ "custom_pipelines": {
119
+ "text-generation": {
120
+ "impl": "h2oai_pipeline.H2OTextGenerationPipeline",
121
+ "pt": "AutoModelForCausalLM"
122
+ }
123
+ },
124
+ "eos_token_id": 11,
125
+ "hidden_dropout": 0.0,
126
+ "hidden_size": 8192,
127
+ "initializer_range": 0.02,
128
+ "layer_norm_epsilon": 1e-05,
129
+ "model_type": "RefinedWeb",
130
+ "n_head": 128,
131
+ "n_head_kv": 8,
132
+ "n_layer": 60,
133
+ "parallel_attn": true,
134
+ "torch_dtype": "float16",
135
+ "transformers_version": "4.30.0.dev0",
136
+ "use_cache": true,
137
+ "vocab_size": 65024
138
+ }
139
+
140
+ ```
141
+
142
+ ## Model Validation
143
+
144
+ Model validation results using [EleutherAI lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness).
145
+
146
+
147
+
148
+ TBD
149
+
150
+
151
+ ## Disclaimer
152
+
153
+ 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.
154
+
155
+ - 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.
156
+ - 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.
157
+ - 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.
158
+ - 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.
159
+ - 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.
160
+ - 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.
161
+
162
+ 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.