nico248000000000 commited on
Commit
7741c6b
·
verified ·
1 Parent(s): a9e120c

Upload Qwen3.8-27B_merged_16bit

Browse files
README.md CHANGED
@@ -1,21 +1,121 @@
1
  ---
2
  base_model: Qwen/Qwen3.8-27B
3
- tags:
4
- - text-generation-inference
5
- - transformers
6
- - unsloth
7
- - qwen3_5
8
- license: apache-2.0
9
  language:
10
  - en
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # Uploaded finetuned model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- - **Developed by:** nico248000000000
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** Qwen/Qwen3.8-27B
18
 
19
- This qwen3_5 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
20
 
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
1
  ---
2
  base_model: Qwen/Qwen3.8-27B
3
+ library_name: transformers
4
+ pipeline_tag: image-text-to-text
5
+ license: other
 
 
 
6
  language:
7
  - en
8
+ - fr
9
+ tags:
10
+ - unsloth
11
+ - lora
12
+ - qlora
13
+ - cyber
14
+ - image-text-to-text
15
+ - vision
16
+ - video
17
+
18
+ model-index:
19
+ - name: Qwen3.8-27B-cyber
20
+ results:
21
+ - task:
22
+ type: text-generation
23
+ name: Causal language modeling
24
+ dataset:
25
+ name: cyber SFT holdout
26
+ type: dataset_cyber.jsonl
27
+ metrics:
28
+ - type: loss
29
+ value: 0.741224
30
+ name: eval_loss
31
  ---
32
 
33
+ # Qwen3.8-27B-cyber
34
+
35
+ Instruction-tuned cybersecurity assistant (offensive, defensive, GRC, architecture, SOC/DFIR, RSSI).
36
+
37
+ | | |
38
+ |---|---|
39
+ | **Base model** | [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) |
40
+ | **Domain** | cyber |
41
+ | **Method** | LoRA / QLoRA (Unsloth) · rank 8 · α 16 |
42
+ | **Quantization at train** | bf16 LoRA |
43
+ | **Context** | 2048 tokens |
44
+ | **Dataset** | `dataset_cyber.jsonl` · train 57718 / eval 584 |
45
+ | **GPU** | NVIDIA RTX PRO 6000 Blackwell Server Edition (95.0 GiB) |
46
+ | **Wall time** | 53.0 min |
47
+ | **Modalities kept** | vision, video |
48
+
49
+ This checkpoint continues a strong general model and specialises it on a curated SFT corpus of cybersecurity procedures: pentest / red team, SOC and DFIR, cloud and identity, GRC (ISO, NIST, NIS2, DORA), and RSSI / project-management questions. Answers are meant to be concrete (controls, detections, hardening), not generic essays.
50
+
51
+
52
+ ## What changed vs the reference
53
+
54
+ Reference = the published base checkpoint [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B), plus the first in-run loss (LoRA ≈ 0 at step 0).
55
+
56
+ | Metric | Reference (base / first log) | This fine-tune | Δ |
57
+ |---|---:|---:|---:|
58
+ | Train loss (first → last logged) | 2.8025 | 0.1832 | -93.5% |
59
+ | Train loss (best) | — | 0.6627 | — |
60
+ | Eval loss (holdout, first → last) | 0.9783 | 0.7412 | -24.2% |
61
+
62
+ The **first logged train loss** is the closest in-run proxy for the base model (LoRA starts near zero). Option F, when executed, adds an independent holdout comparison against the frozen merged base.
63
+
64
+
65
+ ## Training data
66
+
67
+ - File: `dataset_cyber.jsonl`
68
+ - Path used at train time: `/content/drive/MyDrive/finetuning/dataset_cyber.jsonl`
69
+ - Split: `0.01` holdout, seed 42
70
+ - Format: chat-templated SFT (`messages` / `instruction`+`output` / `### Instruction` + `### Response`)
71
+
72
+ ## Training procedure
73
+
74
+ | Hyperparameter | Value |
75
+ |---|---|
76
+ | Epochs | 1 |
77
+ | Learning rate | 0.0002 |
78
+ | Warmup ratio | 0.05 |
79
+ | Device batch | 4 |
80
+ | Grad accum | 2 |
81
+ | Effective batch | 8 |
82
+ | Optim | adamw_8bit |
83
+ | Packing | True |
84
+ | LoRA targets | `['q_proj', 'k_proj', 'v_proj', 'o_proj', 'out_proj', 'gate_proj', 'up_proj', 'down_proj']` |
85
+
86
+ ## Intended use
87
+
88
+ Authorized defensive work, tabletop exercises, control design, detection engineering, audit readiness, and explaining attack techniques **without** weaponized payloads.
89
+
90
+ **Out of scope:** Do not use it to attack systems you do not own, to generate exploit payloads, or as a substitute for a licensed auditor or incident commander.
91
+
92
+ ## Multimodal
93
+
94
+ Kept towers: **vision, video**. Vision/audio layers were frozen during text SFT (vision=False, audio=False). Load the merged Transformers folder (or GGUF + `mmproj`) to keep image / video / audio.
95
+
96
+
97
+ ## How to use
98
+
99
+ ```python
100
+ from transformers import AutoModelForCausalLM, AutoTokenizer
101
+ import torch
102
+
103
+ repo = "nico248000000000/Qwen3.8-27B-cyber"
104
+ tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
105
+ model = AutoModelForCausalLM.from_pretrained(
106
+ repo, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True,
107
+ )
108
+ messages = [{"role": "user", "content": 'How do you design a reliable Zero Trust infrastructure? Answer with a concrete control list.'}]
109
+ inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
110
+ print(tok.decode(model.generate(inputs, max_new_tokens=256)[0], skip_special_tokens=True))
111
+ ```
112
+
113
+ ## Limitations
114
 
115
+ - Domain shift: quality drops outside the SFT topics.
116
+ - Eval above is **holdout loss** (and optional targeted checks). It is not a public leaderboard.
117
+ - The base model license and acceptable-use policy still apply.
118
 
119
+ ## License
120
 
121
+ `other` inherit and respect the license of `Qwen/Qwen3.8-27B`.
config.json CHANGED
@@ -2,9 +2,7 @@
2
  "architectures": [
3
  "Qwen3_5ForConditionalGeneration"
4
  ],
5
- "bos_token_id": null,
6
  "torch_dtype": "bfloat16",
7
- "eos_token_id": 248046,
8
  "image_token_id": 248056,
9
  "language_model_only": false,
10
  "model_name": "Qwen/Qwen3.8-27B",
@@ -123,7 +121,6 @@
123
  },
124
  "tie_word_embeddings": false,
125
  "unsloth_version": "2026.8.18",
126
- "use_cache": false,
127
  "video_token_id": 248057,
128
  "vision_config": {
129
  "deepstack_visual_indexes": [],
 
2
  "architectures": [
3
  "Qwen3_5ForConditionalGeneration"
4
  ],
 
5
  "torch_dtype": "bfloat16",
 
6
  "image_token_id": 248056,
7
  "language_model_only": false,
8
  "model_name": "Qwen/Qwen3.8-27B",
 
121
  },
122
  "tie_word_embeddings": false,
123
  "unsloth_version": "2026.8.18",
 
124
  "video_token_id": 248057,
125
  "vision_config": {
126
  "deepstack_visual_indexes": [],
generation_config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
 
2
  "do_sample": true,
3
  "eos_token_id": [
4
- 248046,
5
  248046,
6
  248044
7
  ],
 
1
  {
2
+ "bos_token_id": 248044,
3
  "do_sample": true,
4
  "eos_token_id": [
 
5
  248046,
6
  248044
7
  ],
model-00001-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ad9559c2657909f8fbc572968eb70876b492463c852ab42418af5a4e9b41b566
3
  size 3966730552
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba0ce20aae489ad196733da5064bcdf159a1fe84f53336648196e1ebb7751b1c
3
  size 3966730552
model-00002-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:625ecb1fc2f1a31645f4058b28c801ea8f0bc857221f66924e56297e06bfd306
3
  size 3043080328
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06a148c01bfbe3faa14a5f184a7ff29a706f7ae1c8b2705d2058e26d17a001fb
3
  size 3043080328
model-00004-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5144613f85e0891598f358c11ef7683959d75f45712ead4ecc39493242529b58
3
  size 3988973152
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:511e34063187882659753c4d93f3859f93c019fd438d8813071921c81d9a3f1a
3
  size 3988973152
model-00005-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8af79f78494386beac8071441ffef0fad0c6b720598602953651235f0d68e52b
3
  size 2099339864
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:635cb53446dc74f219740fc59e18b774f877b803b9722e289ca62575a6efa701
3
  size 2099339864
model-00006-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c2075046094cf0be65a59d3a3ea90fc43f9feba91df3eac4b3acaeadf67f04cc
3
  size 3979553696
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bc5214fac607f0e6cc92eec3789d4b8559410ef9fce66621ba8158e8410dae0
3
  size 3979553696
model-00008-of-00018.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d934f4b1ff850631a392425347e671682e490e7114239b9b075853241cefd73a
3
  size 3979553696
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7192c5b66185d3592927daabee1cc19e6f6e0ce75988ee20e824b624765fda79
3
  size 3979553696
tokenizer_config.json CHANGED
@@ -21,7 +21,7 @@
21
  "vision_eos_token": "<|vision_end|>"
22
  },
23
  "pad_token": "<|endoftext|>",
24
- "padding_side": "right",
25
  "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
26
  "processor_class": "Qwen3VLProcessor",
27
  "split_special_tokens": false,
@@ -295,6 +295,5 @@
295
  "normalized": false,
296
  "special": true
297
  }
298
- },
299
- "chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- set reasoning_instructions = '' %}\n{%- if enable_thinking is undefined or enable_thinking is true %}\n {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}\n {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}\n {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}\n {%- endif %}\n {%- if resolved_reasoning_effort == 'xhigh' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}\n {%- elif resolved_reasoning_effort == 'low' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}\n {%- endif %}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {%- if reasoning_instructions %}\n {{- reasoning_instructions + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '<|im_start|>system\\n' + (reasoning_instructions + '\\n\\n' if reasoning_instructions else '') + content + '<|im_end|>\\n' }}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' }}\n {%- endif %}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content, false)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {{- raise_exception('No user query found in messages.') }}\n{%- endif %}\n{%- for message in messages %}\n {%- set content = render_content(message.content, true)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- else %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is defined and tool_call.arguments != '' %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}"
300
- }
 
21
  "vision_eos_token": "<|vision_end|>"
22
  },
23
  "pad_token": "<|endoftext|>",
24
+ "padding_side": "left",
25
  "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
26
  "processor_class": "Qwen3VLProcessor",
27
  "split_special_tokens": false,
 
295
  "normalized": false,
296
  "special": true
297
  }
298
+ }
299
+ }