electron271 commited on
Commit
5965550
·
verified ·
1 Parent(s): 83b6b4e

Upload Modelfile with huggingface_hub

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