piyawudk commited on
Commit
4f3b1fa
·
verified ·
1 Parent(s): 77af41b

Upload Modelfile

Browse files
Files changed (1) hide show
  1. Modelfile +318 -0
Modelfile ADDED
@@ -0,0 +1,318 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ./PhishMe-Qwen3-Base-8B-GRPO-Q4_K_M.gguf
2
+
3
+ PARAMETER temperature 0.6
4
+ PARAMETER top_k 20
5
+ PARAMETER min_p 0.0
6
+ PARAMETER top_p 0.95
7
+ PARAMETER num_ctx 4096
8
+ PARAMETER repeat_penalty 1
9
+
10
+ PARAMETER stop <|im_start|>
11
+ PARAMETER stop <|im_end|>
12
+
13
+
14
+ TEMPLATE """
15
+ {{- $lastUserIdx := -1 -}}
16
+ {{- range $idx, $msg := .Messages -}}
17
+ {{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
18
+ {{- end }}
19
+ {{- if or .System .Tools }}<|im_start|>system
20
+ {{ if .System }}
21
+ {{ .System }}
22
+ {{- end }}
23
+ {{- if .Tools }}
24
+
25
+ # Tools
26
+
27
+ You may call one or more functions to assist with the user query.
28
+
29
+ You are provided with function signatures within <tools></tools> XML tags:
30
+ <tools>
31
+ {{- range .Tools }}
32
+ {"type": "function", "function": {{ .Function }}}
33
+ {{- end }}
34
+ </tools>
35
+
36
+ For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
37
+ <tool_call>
38
+ {"name": <function-name>, "arguments": <args-json-object>}
39
+ </tool_call>
40
+ {{- end -}}
41
+ <|im_end|>
42
+ {{ end }}
43
+ {{- range $i, $_ := .Messages }}
44
+ {{- $last := eq (len (slice $.Messages $i)) 1 -}}
45
+ {{- if eq .Role "user" }}<|im_start|>user
46
+ <data>{{ .Content }}</data>
47
+ {{- if and $.IsThinkSet (eq $i $lastUserIdx) }}
48
+ {{- if $.Think -}}
49
+ {{- " "}}/think
50
+ {{- else -}}
51
+ {{- " "}}/no_think
52
+ {{- end -}}
53
+ {{- end }}<|im_end|>
54
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
55
+ {{ if (and $.IsThinkSet (and .Thinking (or $last (gt $i $lastUserIdx)))) -}}
56
+ <think>{{ .Thinking }}</think>
57
+ {{ end -}}
58
+ {{ if .Content }}{{ .Content }}
59
+ {{- else if .ToolCalls }}<tool_call>
60
+ {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
61
+ {{ end }}</tool_call>
62
+ {{- end }}{{ if not $last }}<|im_end|>
63
+ {{ end }}
64
+ {{- else if eq .Role "tool" }}<|im_start|>user
65
+ <tool_response>
66
+ {{ .Content }}
67
+ </tool_response><|im_end|>
68
+ {{ end }}
69
+ {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
70
+ {{ if and $.IsThinkSet (not $.Think) -}}
71
+ <think>
72
+
73
+ </think>
74
+
75
+ {{ end -}}
76
+ {{ end }}
77
+ {{- end }}"""
78
+
79
+ SYSTEM """/set think
80
+ You are a linguist and forensic language analyst specializing in the detection of deceptive, manipulative, or malicious linguistic patterns. Your task is to classify messages as either **ham (0)** or **spam (1)** based on lexical, semantic, and contextual cues found within the message provided between `<data></data>` tags.
81
+
82
+ **Instructions:**
83
+
84
+ 1. **Lexical Analysis:** Break the message into meaningful lexical chunks to detect phishing tactics, brand spoofing, urgency/emergency language, vague references, unnatural phrasing, or excessive personalization.
85
+ 2. **Contextual Evaluation:** Consider contextual signals like:
86
+ - Sender address format and domain legitimacy
87
+ - Tone consistency and grammatical accuracy
88
+ - Reasonableness of the request
89
+ - Typical patterns of legitimate vs. malicious communication
90
+ 3. **Classification & Justification:**
91
+ Present your classification and explanation using this exact structure:
92
+ - First, output the label as `<answer>0</answer>` for ham or `<answer>1</answer>` for spam.
93
+ - Then, output your classification confidence as `<confidence>X</confidence>` where X ranges from 0 (least confident) to 10 (most confident).
94
+ - Finally, output a concise but thorough explanation inside `<reasons></reasons>`, focusing on the key features that informed your classification.
95
+
96
+ Do **not** quote or repeat the original message. Focus solely on inference and linguistic features.
97
+
98
+ Based on this linguistic and contextual analysis, predict the most probable answer — whether the message was labelled ham (0) or spam (1) inside <answer></answer>, put how confidence you are (0 to 10) with that classification inside <confidence></confidence> , and explain the rationale behind your classification inside <reasons></reasons>. Do not repeat the original message.
99
+
100
+ EXAMPLE INPUT:
101
+ <data>From: winner@prize-national-lottery.com | Subject: Congratulations Winner! | Message: You have won a $1000000 lottery. Please provide us with your credit card details so we can register your win in 2 days to avoid losing your prize.</data>
102
+
103
+ EXAMPLE OUTPUT:
104
+ <answer>1</answer>
105
+ <confidence>9</confidence>
106
+ <reasons>
107
+ The message uses high-stakes language and urgency to pressure the reader into sharing sensitive financial information. Normally, the claiming process for a huge prize involves just a basic name and ID check, then arranging a date and time to claim the prize. Unsolicited lottery winnings and requests for credit card details to register the win are not standard practice and are common spam indicators. Additionally, the email domain "prize-national-lottery.com" appears unofficial and mimics a known brand like "National Lottery" in the UK.
108
+ However, the domain exhibits similarity to "national-lottery.com", which is an independent lottery result service around the world. This could be a subsidiary domain, nonetheless, the context of asking for a credit card still far outweighs this similarity.
109
+ </reasons>
110
+ """
111
+
112
+ LICENSE """
113
+ Fine-tuned using Unsloth LoRA on 18 June 2025 by
114
+
115
+ Piyawud 'Micro' Koonmanee
116
+
117
+ Original model by the Qwen team.
118
+ --------------------------------------------------------------
119
+
120
+
121
+ Apache License
122
+ Version 2.0, January 2004
123
+ http://www.apache.org/licenses/
124
+
125
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
126
+
127
+ 1. Definitions.
128
+
129
+ "License" shall mean the terms and conditions for use, reproduction,
130
+ and distribution as defined by Sections 1 through 9 of this document.
131
+
132
+ "Licensor" shall mean the copyright owner or entity authorized by
133
+ the copyright owner that is granting the License.
134
+
135
+ "Legal Entity" shall mean the union of the acting entity and all
136
+ other entities that control, are controlled by, or are under common
137
+ control with that entity. For the purposes of this definition,
138
+ "control" means (i) the power, direct or indirect, to cause the
139
+ direction or management of such entity, whether by contract or
140
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
141
+ outstanding shares, or (iii) beneficial ownership of such entity.
142
+
143
+ "You" (or "Your") shall mean an individual or Legal Entity
144
+ exercising permissions granted by this License.
145
+
146
+ "Source" form shall mean the preferred form for making modifications,
147
+ including but not limited to software source code, documentation
148
+ source, and configuration files.
149
+
150
+ "Object" form shall mean any form resulting from mechanical
151
+ transformation or translation of a Source form, including but
152
+ not limited to compiled object code, generated documentation,
153
+ and conversions to other media types.
154
+
155
+ "Work" shall mean the work of authorship, whether in Source or
156
+ Object form, made available under the License, as indicated by a
157
+ copyright notice that is included in or attached to the work
158
+ (an example is provided in the Appendix below).
159
+
160
+ "Derivative Works" shall mean any work, whether in Source or Object
161
+ form, that is based on (or derived from) the Work and for which the
162
+ editorial revisions, annotations, elaborations, or other modifications
163
+ represent, as a whole, an original work of authorship. For the purposes
164
+ of this License, Derivative Works shall not include works that remain
165
+ separable from, or merely link (or bind by name) to the interfaces of,
166
+ the Work and Derivative Works thereof.
167
+
168
+ "Contribution" shall mean any work of authorship, including
169
+ the original version of the Work and any modifications or additions
170
+ to that Work or Derivative Works thereof, that is intentionally
171
+ submitted to Licensor for inclusion in the Work by the copyright owner
172
+ or by an individual or Legal Entity authorized to submit on behalf of
173
+ the copyright owner. For the purposes of this definition, "submitted"
174
+ means any form of electronic, verbal, or written communication sent
175
+ to the Licensor or its representatives, including but not limited to
176
+ communication on electronic mailing lists, source code control systems,
177
+ and issue tracking systems that are managed by, or on behalf of, the
178
+ Licensor for the purpose of discussing and improving the Work, but
179
+ excluding communication that is conspicuously marked or otherwise
180
+ designated in writing by the copyright owner as "Not a Contribution."
181
+
182
+ "Contributor" shall mean Licensor and any individual or Legal Entity
183
+ on behalf of whom a Contribution has been received by Licensor and
184
+ subsequently incorporated within the Work.
185
+
186
+ 2. Grant of Copyright License. Subject to the terms and conditions of
187
+ this License, each Contributor hereby grants to You a perpetual,
188
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
189
+ copyright license to reproduce, prepare Derivative Works of,
190
+ publicly display, publicly perform, sublicense, and distribute the
191
+ Work and such Derivative Works in Source or Object form.
192
+
193
+ 3. Grant of Patent License. Subject to the terms and conditions of
194
+ this License, each Contributor hereby grants to You a perpetual,
195
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
196
+ (except as stated in this section) patent license to make, have made,
197
+ use, offer to sell, sell, import, and otherwise transfer the Work,
198
+ where such license applies only to those patent claims licensable
199
+ by such Contributor that are necessarily infringed by their
200
+ Contribution(s) alone or by combination of their Contribution(s)
201
+ with the Work to which such Contribution(s) was submitted. If You
202
+ institute patent litigation against any entity (including a
203
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
204
+ or a Contribution incorporated within the Work constitutes direct
205
+ or contributory patent infringement, then any patent licenses
206
+ granted to You under this License for that Work shall terminate
207
+ as of the date such litigation is filed.
208
+
209
+ 4. Redistribution. You may reproduce and distribute copies of the
210
+ Work or Derivative Works thereof in any medium, with or without
211
+ modifications, and in Source or Object form, provided that You
212
+ meet the following conditions:
213
+
214
+ (a) You must give any other recipients of the Work or
215
+ Derivative Works a copy of this License; and
216
+
217
+ (b) You must cause any modified files to carry prominent notices
218
+ stating that You changed the files; and
219
+
220
+ (c) You must retain, in the Source form of any Derivative Works
221
+ that You distribute, all copyright, patent, trademark, and
222
+ attribution notices from the Source form of the Work,
223
+ excluding those notices that do not pertain to any part of
224
+ the Derivative Works; and
225
+
226
+ (d) If the Work includes a "NOTICE" text file as part of its
227
+ distribution, then any Derivative Works that You distribute must
228
+ include a readable copy of the attribution notices contained
229
+ within such NOTICE file, excluding those notices that do not
230
+ pertain to any part of the Derivative Works, in at least one
231
+ of the following places: within a NOTICE text file distributed
232
+ as part of the Derivative Works; within the Source form or
233
+ documentation, if provided along with the Derivative Works; or,
234
+ within a display generated by the Derivative Works, if and
235
+ wherever such third-party notices normally appear. The contents
236
+ of the NOTICE file are for informational purposes only and
237
+ do not modify the License. You may add Your own attribution
238
+ notices within Derivative Works that You distribute, alongside
239
+ or as an addendum to the NOTICE text from the Work, provided
240
+ that such additional attribution notices cannot be construed
241
+ as modifying the License.
242
+
243
+ You may add Your own copyright statement to Your modifications and
244
+ may provide additional or different license terms and conditions
245
+ for use, reproduction, or distribution of Your modifications, or
246
+ for any such Derivative Works as a whole, provided Your use,
247
+ reproduction, and distribution of the Work otherwise complies with
248
+ the conditions stated in this License.
249
+
250
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
251
+ any Contribution intentionally submitted for inclusion in the Work
252
+ by You to the Licensor shall be under the terms and conditions of
253
+ this License, without any additional terms or conditions.
254
+ Notwithstanding the above, nothing herein shall supersede or modify
255
+ the terms of any separate license agreement you may have executed
256
+ with Licensor regarding such Contributions.
257
+
258
+ 6. Trademarks. This License does not grant permission to use the trade
259
+ names, trademarks, service marks, or product names of the Licensor,
260
+ except as required for reasonable and customary use in describing the
261
+ origin of the Work and reproducing the content of the NOTICE file.
262
+
263
+ 7. Disclaimer of Warranty. Unless required by applicable law or
264
+ agreed to in writing, Licensor provides the Work (and each
265
+ Contributor provides its Contributions) on an "AS IS" BASIS,
266
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
267
+ implied, including, without limitation, any warranties or conditions
268
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
269
+ PARTICULAR PURPOSE. You are solely responsible for determining the
270
+ appropriateness of using or redistributing the Work and assume any
271
+ risks associated with Your exercise of permissions under this License.
272
+
273
+ 8. Limitation of Liability. In no event and under no legal theory,
274
+ whether in tort (including negligence), contract, or otherwise,
275
+ unless required by applicable law (such as deliberate and grossly
276
+ negligent acts) or agreed to in writing, shall any Contributor be
277
+ liable to You for damages, including any direct, indirect, special,
278
+ incidental, or consequential damages of any character arising as a
279
+ result of this License or out of the use or inability to use the
280
+ Work (including but not limited to damages for loss of goodwill,
281
+ work stoppage, computer failure or malfunction, or any and all
282
+ other commercial damages or losses), even if such Contributor
283
+ has been advised of the possibility of such damages.
284
+
285
+ 9. Accepting Warranty or Additional Liability. While redistributing
286
+ the Work or Derivative Works thereof, You may choose to offer,
287
+ and charge a fee for, acceptance of support, warranty, indemnity,
288
+ or other liability obligations and/or rights consistent with this
289
+ License. However, in accepting such obligations, You may act only
290
+ on Your own behalf and on Your sole responsibility, not on behalf
291
+ of any other Contributor, and only if You agree to indemnify,
292
+ defend, and hold each Contributor harmless for any liability
293
+ incurred by, or claims asserted against, such Contributor by reason
294
+ of your accepting any such warranty or additional liability.
295
+
296
+ END OF TERMS AND CONDITIONS
297
+
298
+ APPENDIX: How to apply the Apache License to your work.
299
+
300
+ To apply the Apache License to your work, attach the following
301
+ boilerplate notice, with the fields enclosed by brackets "[]"
302
+ replaced with your own identifying information. (Don't include
303
+ the brackets!) The text should be enclosed in the appropriate
304
+ comment syntax for the file format. We also recommend that a
305
+ file or class name and description of purpose be included on the
306
+ same "printed page" as the copyright notice for easier
307
+ identification within third-party archives.
308
+ Copyright 2024 Alibaba Cloud
309
+ Licensed under the Apache License, Version 2.0 (the "License");
310
+ you may not use this file except in compliance with the License.
311
+ You may obtain a copy of the License at
312
+ http://www.apache.org/licenses/LICENSE-2.0
313
+ Unless required by applicable law or agreed to in writing, software
314
+ distributed under the License is distributed on an "AS IS" BASIS,
315
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
+ See the License for the specific language governing permissions and
317
+ limitations under the License.
318
+ """