arnocandel commited on
Commit
e6ee600
1 Parent(s): 9662ed9

commit files to HF hub

Browse files
Files changed (1) hide show
  1. README.md +152 -1
README.md CHANGED
@@ -1,3 +1,154 @@
1
  ---
2
- license: other
 
 
 
 
 
 
 
 
 
 
 
 
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/openassistant_oasst1_h2ogpt_graded
15
  ---
16
+ # h2oGPT Model Card
17
+ ## Summary
18
+
19
+ H2O.ai's `h2ogpt-research-oasst1-llama-65b` is a 65 billion parameter instruction-following large language model licensed for commercial use.
20
+
21
+ - Base model: [decapoda-research/llama-65b-hf](https://huggingface.co/decapoda-research/llama-65b-hf)
22
+ - Fine-tuning dataset: [h2oai/openassistant_oasst1_h2ogpt_graded](https://huggingface.co/datasets/h2oai/openassistant_oasst1_h2ogpt_graded)
23
+ - Data-prep and fine-tuning code: [H2O.ai GitHub](https://github.com/h2oai/h2ogpt)
24
+ - Training logs: [zip](https://huggingface.co/h2oai/h2ogpt-research-oasst1-llama-65b/blob/main/llama-65b-hf.h2oaiopenassistant_oasst1_h2ogpt_graded.1_epochs.113510499324f0f007cbec9d9f1f8091441f2469.3.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, AutoTokenizer
45
+
46
+ tokenizer = AutoTokenizer.from_pretrained("h2oai/h2ogpt-research-oasst1-llama-65b", padding_side="left")
47
+ generate_text = pipeline(model="h2oai/h2ogpt-research-oasst1-llama-65b", tokenizer=tokenizer, torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto", prompt_type="human_bot")
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-research-oasst1-llama-65b/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-research-oasst1-llama-65b", padding_side="left")
61
+ model = AutoModelForCausalLM.from_pretrained("h2oai/h2ogpt-research-oasst1-llama-65b", torch_dtype=torch.bfloat16, device_map="auto")
62
+ generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer, prompt_type="human_bot")
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
+ LlamaForCausalLM(
72
+ (model): LlamaModel(
73
+ (embed_tokens): Embedding(32000, 8192, padding_idx=31999)
74
+ (layers): ModuleList(
75
+ (0-79): 80 x LlamaDecoderLayer(
76
+ (self_attn): LlamaAttention(
77
+ (q_proj): Linear(in_features=8192, out_features=8192, bias=False)
78
+ (k_proj): Linear(in_features=8192, out_features=8192, bias=False)
79
+ (v_proj): Linear(in_features=8192, out_features=8192, bias=False)
80
+ (o_proj): Linear(in_features=8192, out_features=8192, bias=False)
81
+ (rotary_emb): LlamaRotaryEmbedding()
82
+ )
83
+ (mlp): LlamaMLP(
84
+ (gate_proj): Linear(in_features=8192, out_features=22016, bias=False)
85
+ (down_proj): Linear(in_features=22016, out_features=8192, bias=False)
86
+ (up_proj): Linear(in_features=8192, out_features=22016, bias=False)
87
+ (act_fn): SiLUActivation()
88
+ )
89
+ (input_layernorm): LlamaRMSNorm()
90
+ (post_attention_layernorm): LlamaRMSNorm()
91
+ )
92
+ )
93
+ (norm): LlamaRMSNorm()
94
+ )
95
+ (lm_head): Linear(in_features=8192, out_features=32000, bias=False)
96
+ )
97
+ ```
98
+
99
+ ## Model Configuration
100
+
101
+ ```json
102
+ LlamaConfig {
103
+ "_name_or_path": "h2oai/h2ogpt-research-oasst1-llama-65b",
104
+ "architectures": [
105
+ "LlamaForCausalLM"
106
+ ],
107
+ "bos_token_id": 0,
108
+ "custom_pipelines": {
109
+ "text-generation": {
110
+ "impl": "h2oai_pipeline.H2OTextGenerationPipeline",
111
+ "pt": "AutoModelForCausalLM"
112
+ }
113
+ },
114
+ "eos_token_id": 1,
115
+ "hidden_act": "silu",
116
+ "hidden_size": 8192,
117
+ "initializer_range": 0.02,
118
+ "intermediate_size": 22016,
119
+ "max_position_embeddings": 2048,
120
+ "max_sequence_length": 2048,
121
+ "model_type": "llama",
122
+ "num_attention_heads": 64,
123
+ "num_hidden_layers": 80,
124
+ "pad_token_id": -1,
125
+ "rms_norm_eps": 1e-05,
126
+ "tie_word_embeddings": false,
127
+ "torch_dtype": "float16",
128
+ "transformers_version": "4.30.1",
129
+ "use_cache": true,
130
+ "vocab_size": 32000
131
+ }
132
+
133
+ ```
134
+
135
+ ## Model Validation
136
+
137
+ Model validation results using [EleutherAI lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness).
138
+
139
+
140
+ TBD
141
+
142
+
143
+ ## Disclaimer
144
+
145
+ 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.
146
+
147
+ - 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.
148
+ - 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.
149
+ - 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.
150
+ - 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.
151
+ - 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.
152
+ - 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.
153
+
154
+ 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.