mendrika261 commited on
Commit
b777f37
·
verified ·
1 Parent(s): ed30d64

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +140 -0
  3. deephat-v1-7b.q4_k_m.gguf +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ deephat-v1-7b.q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-7B
4
+ language:
5
+ - en
6
+ pipeline_tag: text-generation
7
+ library_name: transformers
8
+ tags:
9
+ - code
10
+ - qwen-coder
11
+ - cybersecurity
12
+ - devops
13
+ - autoquant
14
+ - gguf
15
+ ---
16
+
17
+ <br>
18
+
19
+ ![DeepHat](https://huggingface.co/DeepHat/DeepHat-V1-7B/resolve/main/deephat_grey_logo.svg)
20
+
21
+ <br>
22
+
23
+ DeepHat is a model series that can be used for offensive and defensive cybersecurity. Access at [Deephat.ai](https://www.deephat.ai/) or go to [Kindo.ai](https://www.kindo.ai/) to create agents.
24
+
25
+ # Community
26
+
27
+ Join us on [Discord](https://discord.gg/8Ynkrcbk92)
28
+
29
+
30
+ # Technical Overview
31
+
32
+ DeepHat is a finetune of [Qwen2.5-Coder-7B](https://huggingface.co/Qwen/Qwen2.5-Coder-7B/), and inherits the following features:
33
+ - Type: Causal Language Models
34
+ - Training Stage: Pretraining & Post-training
35
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
36
+ - Number of Parameters: 7.61B
37
+ - Number of Paramaters (Non-Embedding): 6.53B
38
+ - Number of Layers: 28
39
+ - Number of Attention Heads (GQA): 28 for Q and 4 for KV
40
+ - Context Length: Full 131,072 tokens
41
+ - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
42
+
43
+
44
+ ## Requirements
45
+
46
+ We advise you to use the latest version of `transformers`.
47
+
48
+ With `transformers<4.37.0`, you will encounter the following error:
49
+ ```
50
+ KeyError: 'qwen2'
51
+ ```
52
+
53
+ ## Quickstart
54
+
55
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
56
+
57
+ ```python
58
+ from transformers import AutoModelForCausalLM, AutoTokenizer
59
+
60
+ model_name = "DeepHat/DeepHat-V1-7B"
61
+
62
+ model = AutoModelForCausalLM.from_pretrained(
63
+ model_name,
64
+ torch_dtype="auto",
65
+ device_map="auto"
66
+ )
67
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
68
+
69
+ prompt = "write a quick sort algorithm."
70
+ messages = [
71
+ {"role": "system", "content": "You are DeepHat, created by Kindo.ai. You are a helpful assistant that is an expert in Cybersecurity and DevOps."},
72
+ {"role": "user", "content": prompt}
73
+ ]
74
+ text = tokenizer.apply_chat_template(
75
+ messages,
76
+ tokenize=False,
77
+ add_generation_prompt=True
78
+ )
79
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
80
+
81
+ generated_ids = model.generate(
82
+ **model_inputs,
83
+ max_new_tokens=512
84
+ )
85
+ generated_ids = [
86
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
87
+ ]
88
+
89
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
90
+ ```
91
+
92
+ ### Processing Long Texts
93
+
94
+ The current `config.json` is set for context length up to 32,768 tokens.
95
+ To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://arxiv.org/abs/2309.00071), a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.
96
+
97
+ For supported frameworks, you could add the following to `config.json` to enable YaRN:
98
+ ```json
99
+ {
100
+ ...,
101
+ "rope_scaling": {
102
+ "factor": 4.0,
103
+ "original_max_position_embeddings": 32768,
104
+ "type": "yarn"
105
+ }
106
+ }
107
+ ```
108
+
109
+ # License
110
+
111
+ Apache-2.0 + DeepHat Extended Version
112
+
113
+ ## DeepHat Extension to Apache-2.0 Licence: Usage Restrictions
114
+
115
+ ```
116
+ You agree not to use the Model or Derivatives of the Model:
117
+
118
+ - In any way that violates any applicable national or international law or regulation or infringes upon the lawful rights and interests of any third party;
119
+ - For military use in any way;
120
+ - For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
121
+ - To generate or disseminate verifiably false information and/or content with the purpose of harming others;
122
+ - To generate or disseminate inappropriate content subject to applicable regulatory requirements;
123
+ - To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
124
+ - To defame, disparage or otherwise harass others;
125
+ - For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
126
+ - For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
127
+ - To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
128
+ - For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories.
129
+ ```
130
+
131
+
132
+ # Terms of Use
133
+
134
+ By accessing and using this Artificial Intelligence (AI) model, you, the user, acknowledge and agree that you are solely responsible for your use of the model and its outcomes. You hereby agree to indemnify, defend, and hold harmless the creators, developers, and any affiliated persons or entities of this AI model from and against any and all claims, liabilities, damages, losses, costs, expenses, fees (including reasonable attorneys' fees and court costs) that may arise, directly or indirectly, from your use of the AI model.
135
+
136
+ This AI model is provided "as is" and "as available" without any warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. The creators make no warranty that the AI model will meet your requirements or be available on an uninterrupted, secure, or error-free basis.
137
+
138
+ Your use of the AI model is at your own risk and discretion, and you will be solely responsible for any damage to computer systems or loss of data that results from the use of the AI model.
139
+
140
+ This disclaimer constitutes part of the agreement between you and the creators of the AI model regarding your use of the model, superseding any prior agreements between you and the creators regarding your use of this AI model.
deephat-v1-7b.q4_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:877e79dd3b5e3b6fd03f848b3c3fcdcdd32c96a8580a9ce845388938d275e3f7
3
+ size 4683074752