RichardErkhov commited on
Commit
6c39161
1 Parent(s): c3afc46

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +122 -0
README.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ h2ogpt-gm-7b-mistral-chat-sft-dpo-rag-v1 - bnb 4bits
11
+ - Model creator: https://huggingface.co/h2oai/
12
+ - Original model: https://huggingface.co/h2oai/h2ogpt-gm-7b-mistral-chat-sft-dpo-rag-v1/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ language:
20
+ - en
21
+ library_name: transformers
22
+ tags:
23
+ - gpt
24
+ - llm
25
+ - large language model
26
+ - h2o-llmstudio
27
+ inference: false
28
+ thumbnail: >-
29
+ https://h2o.ai/etc.clientlibs/h2o/clientlibs/clientlib-site/resources/images/favicon.ico
30
+ license: apache-2.0
31
+ ---
32
+ # Model Card
33
+ ## Summary
34
+
35
+ This model was trained using [H2O LLM Studio](https://github.com/h2oai/h2o-llmstudio). Visit [H2O LLM Studio](https://github.com/h2oai/h2o-llmstudio) to learn how to train your own large language models.
36
+ - Base model: [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
37
+
38
+ ## Usage
39
+
40
+ To use the model with the `transformers` library on a machine with GPUs, first make sure you have the `transformers` library installed.
41
+
42
+ ```bash
43
+ pip install transformers==4.36.1
44
+ ```
45
+
46
+ ```python
47
+ import torch
48
+ from transformers import pipeline
49
+
50
+ pipe = pipeline(
51
+ "text-generation",
52
+ model="h2oai/h2ogpt-gm-7b-mistral-chat-sft-dpo-rag-v1",
53
+ torch_dtype=torch.bfloat16,
54
+ device_map="auto",
55
+ )
56
+
57
+ # We use the HF Tokenizer chat template to format each message
58
+ # https://huggingface.co/docs/transformers/main/en/chat_templating
59
+ messages = [
60
+ {"role": "user", "content": "Why is drinking water so healthy?"},
61
+ ]
62
+ prompt = pipe.tokenizer.apply_chat_template(
63
+ messages,
64
+ tokenize=False,
65
+ add_generation_prompt=True,
66
+ )
67
+ res = pipe(
68
+ prompt,
69
+ max_new_tokens=256,
70
+ )
71
+ print(res[0]["generated_text"])
72
+ # <|system|>You are a friendly chatbot</s><|prompt|>Why is drinking water so healthy?</s><|answer|> Drinking water is healthy for several reasons: [...]
73
+ ```
74
+
75
+ ## Quantization and sharding
76
+
77
+ You can load the models using quantization by specifying ```load_in_8bit=True``` or ```load_in_4bit=True```. Also, sharding on multiple GPUs is possible by setting ```device_map=auto```.
78
+
79
+ ## Model Architecture
80
+
81
+ ```
82
+ MistralForCausalLM(
83
+ (model): MistralModel(
84
+ (embed_tokens): Embedding(32000, 4096, padding_idx=0)
85
+ (layers): ModuleList(
86
+ (0-31): 32 x MistralDecoderLayer(
87
+ (self_attn): MistralAttention(
88
+ (q_proj): Linear(in_features=4096, out_features=4096, bias=False)
89
+ (k_proj): Linear(in_features=4096, out_features=1024, bias=False)
90
+ (v_proj): Linear(in_features=4096, out_features=1024, bias=False)
91
+ (o_proj): Linear(in_features=4096, out_features=4096, bias=False)
92
+ (rotary_emb): MistralRotaryEmbedding()
93
+ )
94
+ (mlp): MistralMLP(
95
+ (gate_proj): Linear(in_features=4096, out_features=14336, bias=False)
96
+ (up_proj): Linear(in_features=4096, out_features=14336, bias=False)
97
+ (down_proj): Linear(in_features=14336, out_features=4096, bias=False)
98
+ (act_fn): SiLUActivation()
99
+ )
100
+ (input_layernorm): MistralRMSNorm()
101
+ (post_attention_layernorm): MistralRMSNorm()
102
+ )
103
+ )
104
+ (norm): MistralRMSNorm()
105
+ )
106
+ (lm_head): Linear(in_features=4096, out_features=32000, bias=False)
107
+ )
108
+ ```
109
+
110
+ ## Disclaimer
111
+
112
+ 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.
113
+
114
+ - 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.
115
+ - 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.
116
+ - 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.
117
+ - 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.
118
+ - 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.
119
+ - 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.
120
+
121
+ 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.
122
+