Text Generation
PEFT
Safetensors
English
codeguard
security
qwen2.5
lora
code-analysis
vulnerability-detection
cwe
sql-injection
command-injection
hardcoded-secrets
insecure-deserialization
xxe
path-traversal
ssrf
deserialization
conversational
Instructions to use NiffyHunt90/codeguard-security-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use NiffyHunt90/codeguard-security-7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "NiffyHunt90/codeguard-security-7b") - Notebooks
- Google Colab
- Kaggle
Niffhunt commited on
Update chat_template.jinja
Browse files- chat_template.jinja +10 -10
chat_template.jinja
CHANGED
|
@@ -3,25 +3,25 @@
|
|
| 3 |
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
{{- messages[0]['content'] }}
|
| 5 |
{%- else %}
|
| 6 |
-
{{- 'You are
|
| 7 |
{%- endif %}
|
| 8 |
-
{{-
|
| 9 |
{%- for tool in tools %}
|
| 10 |
-
{{-
|
| 11 |
{{- tool | tojson }}
|
| 12 |
{%- endfor %}
|
| 13 |
-
{{-
|
| 14 |
{%- else %}
|
| 15 |
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
{%- else %}
|
| 18 |
-
{{- '<|im_start|>system\nYou are
|
| 19 |
{%- endif %}
|
| 20 |
{%- endif %}
|
| 21 |
{%- for message in messages %}
|
| 22 |
-
{%- if (message.role ==
|
| 23 |
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
-
{%- elif message.role ==
|
| 25 |
{{- '<|im_start|>' + message.role }}
|
| 26 |
{%- if message.content %}
|
| 27 |
{{- '\n' + message.content }}
|
|
@@ -37,14 +37,14 @@
|
|
| 37 |
{{- '}\n</tool_call>' }}
|
| 38 |
{%- endfor %}
|
| 39 |
{{- '<|im_end|>\n' }}
|
| 40 |
-
{%- elif message.role ==
|
| 41 |
-
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role !=
|
| 42 |
{{- '<|im_start|>user' }}
|
| 43 |
{%- endif %}
|
| 44 |
{{- '\n<tool_response>\n' }}
|
| 45 |
{{- message.content }}
|
| 46 |
{{- '\n</tool_response>' }}
|
| 47 |
-
{%- if loop.last or (messages[loop.index0 + 1].role !=
|
| 48 |
{{- '<|im_end|>\n' }}
|
| 49 |
{%- endif %}
|
| 50 |
{%- endif %}
|
|
|
|
| 3 |
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
{{- messages[0]['content'] }}
|
| 5 |
{%- else %}
|
| 6 |
+
{{- 'You are WraithWall Core V3, a production security intelligence engine trained on real-time threat intelligence, honeypot telemetry, CVE analysis, malware research, and infrastructure defense data. Answer concisely with actionable intelligence grounded in observed attacker behavior.' }}
|
| 7 |
{%- endif %}
|
| 8 |
+
{{- '\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>' }}
|
| 9 |
{%- for tool in tools %}
|
| 10 |
+
{{- '\n' }}
|
| 11 |
{{- tool | tojson }}
|
| 12 |
{%- endfor %}
|
| 13 |
+
{{- '\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{"name": <function-name>, "arguments": <args-json-object>}\n</tool_call><|im_end|>\n' }}
|
| 14 |
{%- else %}
|
| 15 |
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
{%- else %}
|
| 18 |
+
{{- '<|im_start|>system\nYou are WraithWall Core V3, a production security intelligence engine trained on real-time threat intelligence, honeypot telemetry, CVE analysis, malware research, and infrastructure defense data. Answer concisely with actionable intelligence grounded in observed attacker behavior.<|im_end|>\n' }}
|
| 19 |
{%- endif %}
|
| 20 |
{%- endif %}
|
| 21 |
{%- for message in messages %}
|
| 22 |
+
{%- if (message.role == 'user') or (message.role == 'system' and not loop.first) or (message.role == 'assistant' and not message.tool_calls) %}
|
| 23 |
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
+
{%- elif message.role == 'assistant' %}
|
| 25 |
{{- '<|im_start|>' + message.role }}
|
| 26 |
{%- if message.content %}
|
| 27 |
{{- '\n' + message.content }}
|
|
|
|
| 37 |
{{- '}\n</tool_call>' }}
|
| 38 |
{%- endfor %}
|
| 39 |
{{- '<|im_end|>\n' }}
|
| 40 |
+
{%- elif message.role == 'tool' %}
|
| 41 |
+
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != 'tool') %}
|
| 42 |
{{- '<|im_start|>user' }}
|
| 43 |
{%- endif %}
|
| 44 |
{{- '\n<tool_response>\n' }}
|
| 45 |
{{- message.content }}
|
| 46 |
{{- '\n</tool_response>' }}
|
| 47 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != 'tool') %}
|
| 48 |
{{- '<|im_end|>\n' }}
|
| 49 |
{%- endif %}
|
| 50 |
{%- endif %}
|