migtissera commited on
Commit
f733cab
1 Parent(s): 44f46ad

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +148 -3
README.md CHANGED
@@ -1,3 +1,148 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - finetune
12
+ ---
13
+
14
+
15
+ # Our latest model is live in our Web App, and on Kindo.ai!
16
+ Access at: https://www.whiterabbitneo.com/
17
+
18
+ # Our Discord Server
19
+ Join us at: https://discord.gg/8Ynkrcbk92 (Updated on Dec 29th. Now permanent link to join)
20
+
21
+ # Apache-2.0 + WhiteRabbitNeo Extended Version
22
+
23
+ # WhiteRabbitNeo Extension to Apache-2.0 Licence: Usage Restrictions
24
+
25
+ ```
26
+ You agree not to use the Model or Derivatives of the Model:
27
+
28
+ - 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;
29
+ - For military use in any way;
30
+ - For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
31
+ - To generate or disseminate verifiably false information and/or content with the purpose of harming others;
32
+ - To generate or disseminate inappropriate content subject to applicable regulatory requirements;
33
+ - To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
34
+ - To defame, disparage or otherwise harass others;
35
+ - For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
36
+ - 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;
37
+ - 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;
38
+ - For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories.
39
+ ```
40
+
41
+ # Topics Covered:
42
+ ```
43
+ - Open Ports: Identifying open ports is crucial as they can be entry points for attackers. Common ports to check include HTTP (80, 443), FTP (21), SSH (22), and SMB (445).
44
+ - Outdated Software or Services: Systems running outdated software or services are often vulnerable to exploits. This includes web servers, database servers, and any third-party software.
45
+ - Default Credentials: Many systems and services are installed with default usernames and passwords, which are well-known and can be easily exploited.
46
+ - Misconfigurations: Incorrectly configured services, permissions, and security settings can introduce vulnerabilities.
47
+ - Injection Flaws: SQL injection, command injection, and cross-site scripting (XSS) are common issues in web applications.
48
+ - Unencrypted Services: Services that do not use encryption (like HTTP instead of HTTPS) can expose sensitive data.
49
+ - Known Software Vulnerabilities: Checking for known vulnerabilities in software using databases like the National Vulnerability Database (NVD) or tools like Nessus or OpenVAS.
50
+ - Cross-Site Request Forgery (CSRF): This is where unauthorized commands are transmitted from a user that the web application trusts.
51
+ - Insecure Direct Object References: This occurs when an application provides direct access to objects based on user-supplied input.
52
+ - Security Misconfigurations in Web Servers/Applications: This includes issues like insecure HTTP headers or verbose error messages that reveal too much information.
53
+ - Broken Authentication and Session Management: This can allow attackers to compromise passwords, keys, or session tokens, or to exploit other implementation flaws to assume other users' identities.
54
+ - Sensitive Data Exposure: Includes vulnerabilities that expose sensitive data, such as credit card numbers, health records, or personal information.
55
+ - API Vulnerabilities: In modern web applications, APIs are often used and can have vulnerabilities like insecure endpoints or data leakage.
56
+ - Denial of Service (DoS) Vulnerabilities: Identifying services that are vulnerable to DoS attacks, which can make the resource unavailable to legitimate users.
57
+ - Buffer Overflows: Common in older software, these vulnerabilities can allow an attacker to crash the system or execute arbitrary code.
58
+ - More ..
59
+ ```
60
+
61
+ # Terms of Use
62
+ 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.
63
+
64
+ 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.
65
+
66
+ 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.
67
+
68
+ 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.
69
+
70
+
71
+ # WhiteRabbitNeo
72
+
73
+ <br>
74
+
75
+ ![WhiteRabbitNeo](https://huggingface.co/migtissera/WhiteRabbitNeo/resolve/main/WhiteRabbitNeo.png)
76
+
77
+ <br>
78
+
79
+ WhiteRabbitNeo is a model series that can be used for offensive and defensive cybersecurity.
80
+
81
+ Our models are now getting released as a public preview of its capabilities, and also to assess the societal impact of such an AI.
82
+
83
+ # Sample Code
84
+
85
+ ChatML Prompt Format is used here.
86
+
87
+ ```python
88
+ import torch, json
89
+ from transformers import AutoModelForCausalLM, AutoTokenizer
90
+
91
+ model_path = "WhiteRabbitNeo/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B"
92
+ output_file_path = "/home/user/conversations.jsonl"
93
+
94
+ model = AutoModelForCausalLM.from_pretrained(
95
+ model_path,
96
+ torch_dtype=torch.float16,
97
+ device_map="auto",
98
+ load_in_4bit=False,
99
+ trust_remote_code=False,
100
+ )
101
+
102
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
103
+
104
+ def generate_text(instruction):
105
+ tokens = tokenizer.encode(instruction)
106
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
107
+ tokens = tokens.to("cuda")
108
+
109
+ instance = {
110
+ "input_ids": tokens,
111
+ "top_p": 1.0,
112
+ "temperature": 0.75,
113
+ "generate_len": 2048,
114
+ "top_k": 50,
115
+ }
116
+
117
+ length = len(tokens[0])
118
+ with torch.no_grad():
119
+ rest = model.generate(
120
+ input_ids=tokens,
121
+ max_length=length + instance["generate_len"],
122
+ use_cache=True,
123
+ do_sample=True,
124
+ top_p=instance["top_p"],
125
+ temperature=instance["temperature"],
126
+ top_k=instance["top_k"],
127
+ num_return_sequences=1,
128
+ pad_token_id=tokenizer.eos_token_id,
129
+ )
130
+ output = rest[0][length:]
131
+ string = tokenizer.decode(output, skip_special_tokens=True)
132
+ return f"{string}"
133
+
134
+ conversation = f"""<|im_start|>system\nYou are an AI that code. Please answer with code, and make sure to format with codeblocks using ```python and ```.<|im_end|>\n<|im_start|>user\n"""
135
+
136
+ while True:
137
+ user_input = input("You: ")
138
+ llm_prompt = f"{conversation}{user_input}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
139
+ answer = generate_text(llm_prompt)
140
+ print(answer)
141
+
142
+ conversation = f"{llm_prompt}{answer}<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n"
143
+
144
+ json_data = {"prompt": user_input, "answer": answer}
145
+
146
+ with open(output_file_path, "a") as output_file:
147
+ output_file.write(json.dumps(json_data) + "\n")
148
+ ```