piyawudk commited on
Commit
de7f63b
·
verified ·
1 Parent(s): a5dcb39

Upload Modelfile

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