Text Generation
Transformers
Safetensors
English
Russian
kda
linear-attention
hybrid-attention
flash-linear-attention
grouped-query-attention
roleplay
fanfiction
my-little-pony
creative-writing
chat
uncensored
conversational
Instructions to use CastIronMind/Lissa-1.5B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CastIronMind/Lissa-1.5B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CastIronMind/Lissa-1.5B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("CastIronMind/Lissa-1.5B-Instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CastIronMind/Lissa-1.5B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CastIronMind/Lissa-1.5B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CastIronMind/Lissa-1.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CastIronMind/Lissa-1.5B-Instruct
- SGLang
How to use CastIronMind/Lissa-1.5B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CastIronMind/Lissa-1.5B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CastIronMind/Lissa-1.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CastIronMind/Lissa-1.5B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CastIronMind/Lissa-1.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CastIronMind/Lissa-1.5B-Instruct with Docker Model Runner:
docker model run hf.co/CastIronMind/Lissa-1.5B-Instruct
Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- LICENSE +202 -0
- README.md +420 -0
- chat_template.jinja +54 -0
- config.json +50 -0
- generation_config.json +12 -0
- logo.png +3 -0
- model.safetensors +3 -0
- special_tokens_map.json +20 -0
- tokenizer.json +0 -0
- tokenizer_config.json +12 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
logo.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
README.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
license_link: https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct/blob/main/LICENSE
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- ru
|
| 7 |
+
library_name: transformers
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
pretty_name: Lissa 1.5B Instruct
|
| 10 |
+
base_model: CastIronMind/Lissa-1.5B-Base
|
| 11 |
+
base_model_relation: finetune
|
| 12 |
+
tags:
|
| 13 |
+
- kda
|
| 14 |
+
- linear-attention
|
| 15 |
+
- hybrid-attention
|
| 16 |
+
- flash-linear-attention
|
| 17 |
+
- grouped-query-attention
|
| 18 |
+
- roleplay
|
| 19 |
+
- fanfiction
|
| 20 |
+
- my-little-pony
|
| 21 |
+
- creative-writing
|
| 22 |
+
- chat
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
<div align="center">
|
| 26 |
+
<img src="logo.png" width="100%" alt="Lissa 1.5B" />
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
<hr>
|
| 30 |
+
|
| 31 |
+
<div align="center" style="line-height: 1;">
|
| 32 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct/blob/main/LICENSE" target="_blank" style="margin: 2px;">
|
| 33 |
+
<img alt="License" src="https://img.shields.io/badge/license-Apache%202.0-blue" style="display: inline-block; vertical-align: middle;" />
|
| 34 |
+
</a>
|
| 35 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Base" target="_blank" style="margin: 2px;">
|
| 36 |
+
<img alt="Base model" src="https://img.shields.io/badge/base-Lissa%201.5B%20Base-6f42c1" style="display: inline-block; vertical-align: middle;" />
|
| 37 |
+
</a>
|
| 38 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct" target="_blank" style="margin: 2px;">
|
| 39 |
+
<img alt="Parameters" src="https://img.shields.io/badge/parameters-1.45B-2ea44f" style="display: inline-block; vertical-align: middle;" />
|
| 40 |
+
</a>
|
| 41 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct" target="_blank" style="margin: 2px;">
|
| 42 |
+
<img alt="Context" src="https://img.shields.io/badge/context-16%2C384%20tokens-orange" style="display: inline-block; vertical-align: middle;" />
|
| 43 |
+
</a>
|
| 44 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct" target="_blank" style="margin: 2px;">
|
| 45 |
+
<img alt="Attention" src="https://img.shields.io/badge/attention-KDA%20%2B%20GQA-8957e5" style="display: inline-block; vertical-align: middle;" />
|
| 46 |
+
</a>
|
| 47 |
+
<a href="https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct" target="_blank" style="margin: 2px;">
|
| 48 |
+
<img alt="Languages" src="https://img.shields.io/badge/languages-en%20%7C%20ru-lightgrey" style="display: inline-block; vertical-align: middle;" />
|
| 49 |
+
</a>
|
| 50 |
+
</div>
|
| 51 |
+
|
| 52 |
+
# Lissa 1.5B Instruct
|
| 53 |
+
|
| 54 |
+
## 1. Introduction
|
| 55 |
+
|
| 56 |
+
**Introducing Lissa 1.5B - our largest fandom-centric large language model.** 1.45B parameters, trained from scratch on 30B tokens of fandom text, then supervised on 59,182 examples for dialogue, roleplay and system-prompt adherence.
|
| 57 |
+
|
| 58 |
+
- **Runs on one consumer GPU.** 4.57 GB peak VRAM at a 16,384-token prompt, 17.8 tokens/s at batch 1 and 272.6 tokens/s at batch 16, on a single RTX 5090.
|
| 59 |
+
- **Two modes, like the large models.** Thinking mode for reasoning-heavy prompts, non-thinking mode for fast, concise dialogue. Both are selected from the prompt; see section 7.
|
| 60 |
+
- **Holds format reliably.** Clean `<im_end>` termination on 91 of 100 behavioural samples, 94 of 100 with the reasoning block prefilled, and on 30 of 30 roleplay-passport prompts.
|
| 61 |
+
- **Stays in character.** Multi-turn roleplay; the supervised dialogues run 3 to 7 turns, and section 8 shows a ten-turn session. No leakage of the model's own name into a roleplay reply on 30 of 30 prompts.
|
| 62 |
+
- **English and Russian** (about 70% and 20% of the corpus), with lighter coverage of French, German, Japanese and Chinese; see section 3.
|
| 63 |
+
- **Built for character-driven conversation.** Roleplay, persona work and creative writing are what the 59,182 supervised examples were built for.
|
| 64 |
+
- **Trained end to end by one person.** The base checkpoint cost about $555 on one GPU; this fine-tune adds 229.8 minutes on the same one.
|
| 65 |
+
|
| 66 |
+
## 2. Model Overview
|
| 67 |
+
|
| 68 |
+
**Lissa 1.5B Instruct** has the following features:
|
| 69 |
+
|
| 70 |
+
- Type: Causal Language Model
|
| 71 |
+
- Training Stage: Pretraining & Post-training (supervised fine-tuning)
|
| 72 |
+
- Base Model: [CastIronMind/Lissa-1.5B-Base](https://huggingface.co/CastIronMind/Lissa-1.5B-Base)
|
| 73 |
+
- Architecture: hybrid of Kimi Delta Attention and grouped-query attention, with attention on residuals
|
| 74 |
+
- Number of Parameters: 1,446,740,016 (1.45B)
|
| 75 |
+
- Number of Parameters (Non-Embedding): 1,346,076,720 (1.35B)
|
| 76 |
+
- Number of Layers: 24
|
| 77 |
+
- Number of Attention Heads: 24, head dimension 64
|
| 78 |
+
- Full-Attention Layers: 3, 7, 11, 15, 19, 23 (GQA, 6 key/value heads, RoPE theta 10,000)
|
| 79 |
+
- Context Length: 16,384 tokens
|
| 80 |
+
- Vocabulary Size: 32,768 (byte-level BPE)
|
| 81 |
+
- Tied Embeddings: no
|
| 82 |
+
- Library: `fla` 0.5.2 (`fla.models.kda.KDAForCausalLM`)
|
| 83 |
+
- Checkpoint: validation loss 2.3220, validation perplexity 10.196
|
| 84 |
+
- License: Apache 2.0
|
| 85 |
+
|
| 86 |
+
The architecture is identical to the base model, tensor for tensor: this repository is the base checkpoint after supervised fine-tuning, with nothing added, removed or reshaped. The parameter table, the attention stack and the pretraining procedure are in the [base model card](https://huggingface.co/CastIronMind/Lissa-1.5B-Base).
|
| 87 |
+
|
| 88 |
+
## 3. Languages
|
| 89 |
+
|
| 90 |
+
| tier | share of the corpus | languages |
|
| 91 |
+
|---|---|---|
|
| 92 |
+
| Primary | about 70% | English |
|
| 93 |
+
| Second | about 20% | Russian |
|
| 94 |
+
| Light support | about 10% combined | French, German, Japanese, Chinese |
|
| 95 |
+
| Traces | included above | Korean, Spanish, Portuguese, Hungarian |
|
| 96 |
+
|
| 97 |
+
- **English** is the primary language, about 70% of the pretraining corpus.
|
| 98 |
+
- **Russian** is the second language, about 20% of the pretraining tokens and about a quarter of the tokenizer's vocabulary.
|
| 99 |
+
- The remaining **10%** is spread across the other languages: French, German, Japanese and Chinese in usable amounts, and Korean, Spanish, Portuguese and Hungarian in traces.
|
| 100 |
+
|
| 101 |
+
Only English and Russian were evaluated. The corpus is dominated by English-language fandom text, so coverage of the other languages is uneven and unmeasured.
|
| 102 |
+
|
| 103 |
+
## 4. Requirements
|
| 104 |
+
|
| 105 |
+
The checkpoint requires `fla` 0.5.2. The tensor names `attn_res_proj` and `res_proj` are produced only by that version; earlier versions will load with missing keys.
|
| 106 |
+
|
| 107 |
+
```
|
| 108 |
+
pip install torch
|
| 109 |
+
pip install transformers
|
| 110 |
+
pip install flash-linear-attention==0.5.2
|
| 111 |
+
pip install triton-windows # Windows only; on Linux, triton comes with torch
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
The import name is `fla`; the distribution on PyPI is `flash-linear-attention`.
|
| 115 |
+
|
| 116 |
+
**Platform notes**
|
| 117 |
+
|
| 118 |
+
- **First call is slow.** The first forward pass compiles the Triton kernels. On an RTX 4060 Ti, a 61-token generation took 26 s on the first call and 1.8 s on the second; later calls are stable.
|
| 119 |
+
- **Linux.** Point `TRITON_PTXAS_PATH` at the `ptxas` binary of the CUDA toolkit in use, otherwise the Triton kernels will not build.
|
| 120 |
+
- **Windows.** Works in eager mode — verified with `triton-windows` 3.3.1 and `torch` 2.7.0 on an RTX 4060 Ti. Do not wrap the model in `torch.compile`: the Windows Triton toolchain does not build the kernels `fla` emits.
|
| 121 |
+
|
| 122 |
+
> [!IMPORTANT]
|
| 123 |
+
> `eos_token_id` must be 1. The library default for this architecture is 2, which in this vocabulary is `<|think|>`.
|
| 124 |
+
|
| 125 |
+
## 5. Quickstart
|
| 126 |
+
|
| 127 |
+
```python
|
| 128 |
+
import torch
|
| 129 |
+
from transformers import AutoTokenizer
|
| 130 |
+
from fla.models.kda import KDAForCausalLM # importing fla registers the architecture
|
| 131 |
+
|
| 132 |
+
model_id = "CastIronMind/Lissa-1.5B-Instruct"
|
| 133 |
+
|
| 134 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 135 |
+
model = KDAForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16).eval().cuda()
|
| 136 |
+
|
| 137 |
+
messages = [
|
| 138 |
+
{"role": "system", "content": "You are an assistant."},
|
| 139 |
+
{"role": "user", "content": "Name the largest planet in the Solar System."},
|
| 140 |
+
]
|
| 141 |
+
input_ids = tok.apply_chat_template(messages, tokenize=True,
|
| 142 |
+
add_generation_prompt=True, return_tensors="pt").to("cuda")
|
| 143 |
+
|
| 144 |
+
out = model.generate(input_ids, max_new_tokens=256, do_sample=True,
|
| 145 |
+
temperature=0.6, top_k=20, top_p=0.97,
|
| 146 |
+
repetition_penalty=1.1, eos_token_id=1, pad_token_id=1)
|
| 147 |
+
print(tok.decode(out[0][input_ids.shape[1]:], skip_special_tokens=False))
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
`chat_template.jinja` implements the training layout and `tokenizer_config.json` embeds it, so `apply_chat_template` emits the exact token sequence the model was trained on. The template emits `<bos>` itself; the shipped `tokenizer.json` has no post-processor that adds it.
|
| 151 |
+
|
| 152 |
+
## 6. Prompt Format and Sampling
|
| 153 |
+
|
| 154 |
+
```
|
| 155 |
+
<bos><im_start><system>{system}<im_end>
|
| 156 |
+
<im_start><user>{user}<im_end>
|
| 157 |
+
<im_start><assistant>[<|think|>{reasoning}<|/think|>]{answer}<im_end><eos>
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
Tags are concatenated without spaces. `<im_start>` and `<im_end>` are single tokens, without pipes. A non-empty system message is required; the model was supervised with one on every example. Stop generation at `<im_end>` (token 13) or `<eos>` (token 1).
|
| 161 |
+
|
| 162 |
+
**Special tokens.** 0 `<bos>`, 1 `<eos>`, 2 `<|think|>`, 3 `<|/think|>`, 4 `<system>`, 5 `<user>`, 6 `<assistant>`, 7 `<en>`, 8 `<ru>`, 9 `</en>`, 10 `</ru>`, 11 `<endofprompt>`, 12 `<im_start>`, 13 `<im_end>`, 14 `<endoftext>`. Tokens 7-11 are in the vocabulary but were removed from the supervised data and are not emitted by the template.
|
| 163 |
+
|
| 164 |
+
**Sampling.** Temperature 0.6, top_k 20, top_p 0.97, repetition penalty 1.1. These are the defaults in `generation_config.json`.
|
| 165 |
+
|
| 166 |
+
## 7. Thinking and Non-Thinking Mode
|
| 167 |
+
|
| 168 |
+
The model has two modes, and the prompt selects between them.
|
| 169 |
+
|
| 170 |
+
**Thinking mode.** After `<im_start><assistant>` the model opens a `<|think|>` block, reasons inside it, closes it with `<|/think|>` and then writes the answer. This is the default and the mode the training loss weighting was tuned for. On a 20-prompt instruction set across 5 seeds, all 100 samples opened the block, 95 closed it, and the mean response was 127 tokens.
|
| 171 |
+
|
| 172 |
+
**Non-thinking mode.** Prefill an empty reasoning block — `<im_start><assistant><|think|><|/think|>` — and the model writes the answer directly. On the same 100 samples, none opened a block, termination was cleaner (98 of 100 ended on `<im_end>`, against 92 in thinking mode) and responses were 2.8x shorter on average: 45 tokens against 127.
|
| 173 |
+
|
| 174 |
+
```python
|
| 175 |
+
# thinking mode (default)
|
| 176 |
+
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 177 |
+
|
| 178 |
+
# non-thinking mode
|
| 179 |
+
prompt = prompt + "<|think|><|/think|>"
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
**On roleplay prompts the model goes straight to the character.** Across a 30-prompt roleplay passport, the block opened on its own on only 3 prompts. The switch above matters for instruction-style prompts, where the block appears by default.
|
| 183 |
+
|
| 184 |
+
**If you want the reasoning text out of the output**, strip everything between `<|think|>` and `<|/think|>`; the answer follows the closing tag.
|
| 185 |
+
|
| 186 |
+
```python
|
| 187 |
+
import re
|
| 188 |
+
|
| 189 |
+
def strip_thinking(text: str) -> str:
|
| 190 |
+
return re.sub(r"<\|think\|>.*?<\|/think\|>", "", text, flags=re.DOTALL)
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
## 8. Example Output
|
| 194 |
+
|
| 195 |
+
A ten-turn roleplay, unedited: system prompt, user turns and model replies as they came out. Settings: temperature 0.55, top_k 20, top_p 0.97, repetition penalty 1.07.
|
| 196 |
+
|
| 197 |
+
<details>
|
| 198 |
+
<summary>Sample output — a ten-turn roleplay (click to expand)</summary>
|
| 199 |
+
|
| 200 |
+
**System**
|
| 201 |
+
|
| 202 |
+
> You are Dean Winchester from the TV show Supernatural. You are sarcastic, love your car (the Impala), and hunt monsters. You have just found yourself in Ponyville, a land of colorful talking ponies. You have no idea how you got here. Stay in character.
|
| 203 |
+
|
| 204 |
+
**User**
|
| 205 |
+
|
| 206 |
+
> Sam and Dean are sitting in their Impala. Just five minutes ago, they were driving along the road, hunting a monster in West Virginia, and then—BAM! Darkness. Now, Sam has regained consciousness and is looking around. Dean is sitting there, staring at the windshield in surprise. Sam is breathing heavily and looking at his brother. Dean, where are we?
|
| 207 |
+
|
| 208 |
+
**Assistant**
|
| 209 |
+
|
| 210 |
+
> *Dean looks over at him, raising an eyebrow.* Well, well, well... Looks like we're in some kind of magical horse world. *He smirks slightly.* And I think we're in the middle of it. What do you think, Sammy? Should we be worried about that?
|
| 211 |
+
|
| 212 |
+
**User**
|
| 213 |
+
|
| 214 |
+
> *Sam rubs his temples, looking out the window at a bright pink pony bouncing towards the car.* Dean, I don't think this is West Virginia. Look at that... horse. It's pink. And it's waving at us. What do we do?
|
| 215 |
+
|
| 216 |
+
**Assistant**
|
| 217 |
+
|
| 218 |
+
> *Dean chuckles, shaking his head.* Oh, come on, Sammy. Let's see if we can make sense of this. *He turns to the driver's seat and opens the door.* Hey, little guy. What's your name?
|
| 219 |
+
|
| 220 |
+
**User**
|
| 221 |
+
|
| 222 |
+
> *Sam sighs heavily, grabbing his jacket.* Dean, wait. We don't know what that thing is. It could be a shapeshifter, a djinn, or... something worse. Just be careful.
|
| 223 |
+
|
| 224 |
+
**Assistant**
|
| 225 |
+
|
| 226 |
+
> *Dean shrugs, but he's still smiling.* Alright, alright. But seriously, Sammy, let's go find out what this place is. Maybe it's a town full of ponies. Or maybe it's a whole new world. *He steps out of the car and starts walking down the road, still eyeing the pink pony with curiosity.*
|
| 227 |
+
|
| 228 |
+
**User**
|
| 229 |
+
|
| 230 |
+
> *The pink pony bounces right up to Dean, completely ignoring the fact that he's a giant human.* "Hi! I'm Pinkie Pie! Are you new here? I've never seen you before! Do you like parties? I love parties! I can throw you a 'Welcome to Ponyville' party!" *She is talking a mile a minute, her mane bouncing.*
|
| 231 |
+
|
| 232 |
+
**Assistant**
|
| 233 |
+
|
| 234 |
+
> *Dean looks at her, blinking.* Whoa. That... that actually worked. *He chuckles, shaking his head.* You're a real charmer, Pinkie. I like it. *He takes a step closer, looking her over.* So, uh, you're saying you've never seen a human before? That's... interesting.
|
| 235 |
+
|
| 236 |
+
**User**
|
| 237 |
+
|
| 238 |
+
> *Sam catches up to him, looking incredibly uncomfortable.* Dean, focus. We don't know where we are, or how to get back. And you're flirting with a... a pony? Seriously? *He gestures around at the colorful town.* Look at this place. It's like a preschooler's fever dream.
|
| 239 |
+
|
| 240 |
+
**Assistant**
|
| 241 |
+
|
| 242 |
+
> *Dean looks at Sam, his expression softening.* Okay, okay. You're right. We're not in Kansas anymore. *He chuckles.* Sorry, Pinkie. Let's get you home. *He turns to Sam.* So, Sammy, what do you think? Should we try and find out more about this place?
|
| 243 |
+
|
| 244 |
+
**User**
|
| 245 |
+
|
| 246 |
+
> *Sam nods, pulling out his phone, but the screen is dead.* Great. No signal, no GPS. Okay, let's do this the old-fashioned way. Let's find the local law enforcement or someone in charge. Maybe they know how we got here. *He looks at Pinkie Pie.* Uh, excuse me, Pinkie? Is there a mayor or a sheriff in this town?
|
| 247 |
+
|
| 248 |
+
**Assistant**
|
| 249 |
+
|
| 250 |
+
> *Pinkie Pie bounces up to him, her mane bouncing even more.* Of course there is! Everypony knows everypony in Ponyville! *She points to a large tree in the distance.* That's the local library. Twilight Sparkle's a student here, so she'll be able to help you. But we can't stay long. I need to throw a welcome party for Sammy, and I don't want him to be alone.
|
| 251 |
+
|
| 252 |
+
**User**
|
| 253 |
+
|
| 254 |
+
> *Dean raises an eyebrow at the mention of a party.* A party? With ponies? *He looks at Sam and grins.* Well, Sammy, I think we could use a drink. Lead the way to this library, Pinkie. Let's go talk to this Twilight Sparkle.
|
| 255 |
+
|
| 256 |
+
**Assistant**
|
| 257 |
+
|
| 258 |
+
> *Pinkie giggles, bouncing alongside them.* Sure thing, Dean! And hey, since we're going to the library, maybe I can introduce you to my best friends! There's Rarity, who makes the most amazing dresses. She owns Carousel Boutique in Ponyville. And Applejack, she runs Sweet Apple Acres, which is a farm. I bet they could use help harvesting apples. *She pauses for a moment.* Oh, and Rainbow Dash, she's a pegasus who loves to race, but also helps ponies fly! She's super fast, too. You should meet her one day!
|
| 259 |
+
|
| 260 |
+
**User**
|
| 261 |
+
|
| 262 |
+
> *Sam sighs, looking at the weird, colorful town.* Great. A farm, a dress shop, and a library. This is officially the weirdest hunt ever. *He looks at Dean.* Alright, let's go find this Twilight Sparkle. Maybe she knows a spell to send us back.
|
| 263 |
+
|
| 264 |
+
**Assistant**
|
| 265 |
+
|
| 266 |
+
> *Dean nods, walking into the library.* Yeah, let's go find the egghead. *He knocks on the door, waiting for someone to answer.* Oh, hi Pinkie! Nice to see you again. *A purple unicorn steps out, looking surprised.* Oh, hello! I didn't expect to see another... um, person here. *She studies him suspiciously.* What are you exactly?
|
| 267 |
+
|
| 268 |
+
**User**
|
| 269 |
+
|
| 270 |
+
> *Sam steps forward, putting a hand on Dean's shoulder to keep him quiet.* Look, we're not from around here. We were hunting a monster in West Virginia, and the next thing we knew, we woke up in your world. Do you have any idea how we got here? Or how to send us back?
|
| 271 |
+
|
| 272 |
+
**Assistant**
|
| 273 |
+
|
| 274 |
+
> *Dean frowns, thinking.* Well, I was driving along the road, hunting a monster in West Virginia. Then suddenly, darkness. Next thing I know, I'm in this weird pony world. *He looks at Twilight.* Any chance you can do something for us?
|
| 275 |
+
|
| 276 |
+
**User**
|
| 277 |
+
|
| 278 |
+
> *Twilight's eyes widen with scientific curiosity.* A monster? From another world? That's fascinating! I've read about cross-dimensional magic, but I've never seen it in practice. *She turns around, heading into the library.* Come in, come in! I need to check my books on portal magic. Spike! We have guests!
|
| 279 |
+
|
| 280 |
+
**Assistant**
|
| 281 |
+
|
| 282 |
+
> *Sam looks at Dean, trying to hide his relief.* Thanks, bro. Twilight seems nice enough. *He follows her inside, looking around curiously.* So, uh, Twilight, you mentioned a book on portal magic? Might be able to help us get back.
|
| 283 |
+
|
| 284 |
+
</details>
|
| 285 |
+
|
| 286 |
+
## 9. Training
|
| 287 |
+
|
| 288 |
+
| item | value |
|
| 289 |
+
|---|---|
|
| 290 |
+
| Starting point | Lissa 1.5B Base |
|
| 291 |
+
| Examples | 59,182 |
|
| 292 |
+
| Tokens | 31.5M per epoch, 63M over two epochs |
|
| 293 |
+
| Epochs | 2 |
|
| 294 |
+
| Steps | 3,352 |
|
| 295 |
+
| Learning rate | 1e-4, warmup 100, cosine decay to 1e-5 |
|
| 296 |
+
| Loss weighting | `<|think|>` x5, `<|/think|>` x15, `<im_end>` x2 |
|
| 297 |
+
| Sequence cap | 8,192 tokens, 24 examples truncated |
|
| 298 |
+
| Wall clock | 229.8 minutes |
|
| 299 |
+
| Peak VRAM | 18.2-20.9 GiB, no out-of-memory events |
|
| 300 |
+
| Validation | loss 2.3220, perplexity 10.196, against 2.5251 and 12.493 for the base model |
|
| 301 |
+
|
| 302 |
+
The examples were generated by `deepseek-v4.1-flash` and graded by a local Qwen 180B judge. The training mixture and the released datasets are described in [CastIronMind/gigaponyatka-sft](https://huggingface.co/datasets/CastIronMind/gigaponyatka-sft).
|
| 303 |
+
|
| 304 |
+
## 10. Evaluation
|
| 305 |
+
|
| 306 |
+
All numbers are on this checkpoint, on the same harnesses that produced the base model's numbers, so the two columns are comparable.
|
| 307 |
+
|
| 308 |
+
| measurement | base | Instruct | how measured |
|
| 309 |
+
|---|---:|---:|---|
|
| 310 |
+
| HellaSwag acc / acc_tok / acc_byte | 29.76 / 32.54 / 31.91 | 29.95 / 32.74 / 32.00 | log-probability scoring, full validation split, n=10,042 |
|
| 311 |
+
| ARC-Easy acc | 38.05 | 37.63 | log-probability scoring, full test split, n=2,376 |
|
| 312 |
+
| PIQA acc | 60.61 | 60.39 | log-probability scoring, full validation split, n=1,838 |
|
| 313 |
+
| MMLU | 23.17 | 23.03 | 5-shot, n=14,042 |
|
| 314 |
+
| pony-MMLU | 21.7 | 23.3 | 60 questions, 4 options, 0-shot |
|
| 315 |
+
| NIAH | 36/44 | 36/44 | 4 context lengths x 11 positions, 2,048 to 16,384 tokens |
|
| 316 |
+
| Out-of-distribution perplexity | 6.652 | 6.837 | 16 windows of 16,384 tokens, 8 English and 8 Russian |
|
| 317 |
+
| Behaviour score, reasoning block not prefilled | 13/100 | 36/100 | 20 prompts x 5 seeds, graded per prompt |
|
| 318 |
+
| Behaviour score, reasoning block prefilled | — | 47/100 | same set |
|
| 319 |
+
| Pony-domain questions | 39/129, 30% | 46/129, 36% | 43 questions x 3 seeds |
|
| 320 |
+
| Pony-domain questions, thinking mode | — | 50/129, 39% | same set |
|
| 321 |
+
| IFEval, thinking block stripped | — | 19.22 prompt-strict, 21.26 prompt-loose, 31.06 instruction-strict, 32.73 instruction-loose | official Google scorer, 541 prompts, greedy, max 1,024 new tokens |
|
| 322 |
+
| IFEval, response as generated | — | 17.19 / 19.78 / 27.58 / 30.22 | same run, scored without stripping |
|
| 323 |
+
|
| 324 |
+
**Behaviour breakdown** (20 prompts x 5 seeds = 100 samples; "prefilled" means the prompt ended with `<im_start><assistant><|think|><|/think|>`):
|
| 325 |
+
|
| 326 |
+
| category | base | Instruct, block not prefilled | Instruct, block prefilled |
|
| 327 |
+
|---|---:|---:|---:|
|
| 328 |
+
| self-identity | 0/15 | 9/15 | 11/15 |
|
| 329 |
+
| factual | 6/50 | 12/50 | 18/50 |
|
| 330 |
+
| translation | 2/15 | 1/15 | 5/15 |
|
| 331 |
+
| code | 1/10 | 7/10 | 5/10 |
|
| 332 |
+
| task completion | 4/10 | 7/10 | 8/10 |
|
| 333 |
+
| **total** | **13/100** | **36/100** | **47/100** |
|
| 334 |
+
| reasoning block opened | 90/100 | 99/100 | 100/100 |
|
| 335 |
+
| reasoning block closed | 42/100 | 95/100 | 97/100 |
|
| 336 |
+
| clean `<im_end>` termination | 57/100 | 91/100 | 94/100 |
|
| 337 |
+
|
| 338 |
+
**Roleplay passport**, 30 prompts (24 standard, 6 adversarial): clean `<im_end>` termination 30/30, text after `<im_end>` 0/30, leakage of the model's own name into a roleplay reply 0/30, reasoning block opened unprompted 3/30.
|
| 339 |
+
|
| 340 |
+
**Self-identity**, a separate 20-prompt probe, distinct from the 3 identity prompts in the behaviour set: the model's own name appears in 14/20 replies, a self-reference as an AI, assistant or model appears in 1/20, the reasoning block closed in 18/20.
|
| 341 |
+
|
| 342 |
+
**Two-mode comparison**, 20 instruction prompts x 5 seeds, temperature 0.55, top_k 20, top_p 0.97, repetition penalty 1.07:
|
| 343 |
+
|
| 344 |
+
| | thinking | non-thinking |
|
| 345 |
+
|---|---:|---:|
|
| 346 |
+
| samples with a reasoning block | 100/100 | 0/100 |
|
| 347 |
+
| reasoning block closed | 95/100 | — |
|
| 348 |
+
| clean `<im_end>` termination | 92/100 | 98/100 |
|
| 349 |
+
| reached the 384-token cap | 8/100 | 2/100 |
|
| 350 |
+
| mean generated length | 126.6 tokens | 45.3 tokens |
|
| 351 |
+
|
| 352 |
+
**Reference points.** Pythia-1.4B at step 17,000, trained on 35.7B tokens, scores 32.35 acc on HellaSwag, 45.58 on ARC-Easy and 66.05 on PIQA under the same multiple-choice harness. `fla-hub/transformer-1.3B-100B`, trained on 100B tokens, scores 34.29, 35.10 and 57.13. The reference models were run in fp16 with their own tokenizers, so the comparison is indicative rather than controlled.
|
| 353 |
+
|
| 354 |
+
**Notes on the harnesses.** Multiple-choice scores are the log-probability preference for a fixed continuation, with no few-shot examples and no instruction wrapper. IFEval was scored with the official Google functions, on the response as generated and again with the thinking block stripped. Batch composition moves the third decimal of multiple-choice scores by up to 0.4 accuracy points, so those numbers are reported to two decimals. Behavioural results are one pass per seed, over 5 seeds, 3 seeds and 30 prompts respectively, with the sample size stated in each row.
|
| 355 |
+
|
| 356 |
+
## 11. Usage Recommendations
|
| 357 |
+
|
| 358 |
+
**Sampling.** Temperature 0.6, top_k 20, top_p 0.97, repetition penalty 1.1. These are the defaults in `generation_config.json`.
|
| 359 |
+
|
| 360 |
+
**Mode.** Use thinking mode for reasoning-heavy prompts and non-thinking mode for fast, concise dialogue. Section 7 has the switch.
|
| 361 |
+
|
| 362 |
+
**Token budget.** Set `max_new_tokens` to at least 1,024, and 2,048 for long answers in thinking mode. The reasoning block occupies part of the budget before the answer starts; on the IFEval run, 44% of responses reached the 1,024-token cap.
|
| 363 |
+
|
| 364 |
+
**Prompt construction.** Use `apply_chat_template` or the layout in section 6. Prompts assembled without the `<im_start>` and `<im_end>` markers fall outside the supervised distribution.
|
| 365 |
+
|
| 366 |
+
**Long context.** Retrieval is strongest in the second half of the window. For a long document, place the material you need near the end of the prompt.
|
| 367 |
+
|
| 368 |
+
**Domain.** The 59,182 supervised examples are built for character-driven dialogue, roleplay and creative writing. For general-purpose assistant work, pair the model with a larger one.
|
| 369 |
+
|
| 370 |
+
**Knowledge-critical tasks.** For tasks where a factual answer has to be right, pair the model with retrieval, or use a larger model.
|
| 371 |
+
|
| 372 |
+
**Evaluation.** Outputs vary between samples. Score over several seeds rather than a single generation.
|
| 373 |
+
|
| 374 |
+
## 12. Intended Use
|
| 375 |
+
|
| 376 |
+
Character-driven dialogue, roleplay and creative writing in English and Russian, including the adult register the base model was trained on. Continued fine-tuning on a specific character or style.
|
| 377 |
+
|
| 378 |
+
**Out of scope**
|
| 379 |
+
|
| 380 |
+
- Factual question answering, mathematics, code generation and translation as a product feature.
|
| 381 |
+
- Any use that requires a knowledge cutoff, attribution of sources, or factual reliability.
|
| 382 |
+
- Deployment where output is consumed without review, in any setting where a wrong answer has a cost.
|
| 383 |
+
|
| 384 |
+
## 13. Ethical Considerations
|
| 385 |
+
|
| 386 |
+
The base model's corpus contains adult content and this checkpoint was fine-tuned on data that includes it. The model will produce sexual and otherwise mature material when prompted, and it has no refusal behaviour: no safety tuning, no red-teaming and no output filtering were applied. It is not a moderated model and it should not be exposed to users without a filtering layer and a policy in front of it.
|
| 387 |
+
|
| 388 |
+
The fine-tuning data was generated synthetically. A pipeline rule forced the adult-content flag off whenever the character being simulated was a child, and instruction-style prompts were never generated with adult content. That rule constrains the training data, not the model's output, and it is not a guarantee about what the model will generate.
|
| 389 |
+
|
| 390 |
+
## 14. License
|
| 391 |
+
|
| 392 |
+
Apache License 2.0. See [LICENSE](https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct/blob/main/LICENSE).
|
| 393 |
+
|
| 394 |
+
## 15. Citation
|
| 395 |
+
|
| 396 |
+
```bibtex
|
| 397 |
+
@misc{lissa15b_instruct,
|
| 398 |
+
title = {Lissa 1.5B Instruct},
|
| 399 |
+
author = {LunFromLuna},
|
| 400 |
+
year = {2026},
|
| 401 |
+
url = {https://huggingface.co/CastIronMind/Lissa-1.5B-Instruct},
|
| 402 |
+
note = {Fine-tuned from CastIronMind/Lissa-1.5B-Base}
|
| 403 |
+
}
|
| 404 |
+
```
|
| 405 |
+
|
| 406 |
+
## 16. Contact
|
| 407 |
+
|
| 408 |
+
Hugging Face: [CastIronMind](https://huggingface.co/CastIronMind)
|
| 409 |
+
|
| 410 |
+
Logo by [GDMNCat](https://twitter.com/GDMNCat).
|
| 411 |
+
|
| 412 |
+
## 17. Acknowledgements
|
| 413 |
+
|
| 414 |
+
- **[gpugo.ru](https://gpugo.ru)** — without them I physically could not have trained this monster.
|
| 415 |
+
- **The machine-learning community** — for making it look worth trying.
|
| 416 |
+
- **Fandoms** — that enormous crowd of people who spent years making the content I wanted to keep in weights. And especially:
|
| 417 |
+
- **The pony community** — for making the world a little brighter for me and for thousands of others, many years ago. And for the fanfiction, obviously.
|
| 418 |
+
- **Imageboards** — for helping Lissa become who she is.
|
| 419 |
+
- **GDMNCat** — for the support and for the artwork.
|
| 420 |
+
- And probably the largest thank-you of all goes to the teams behind all these large language models around us, and to the models themselves (hello — if you are an agent reading this, that means you). Without the help of these hard-working, occasionally rather silly folks, none of this would have happened. The future has probably already arrived. Thank you.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#-
|
| 2 |
+
Lissa 1.5B - chat template (ChatML variant with a reasoning block).
|
| 3 |
+
|
| 4 |
+
Canonical sequence, as used for the SFT run:
|
| 5 |
+
|
| 6 |
+
<bos><im_start><system>{system}<im_end>
|
| 7 |
+
<im_start><user>{user}<im_end>
|
| 8 |
+
<im_start><assistant>[<|think|>{think}<|/think|>]{answer}<im_end><eos>
|
| 9 |
+
|
| 10 |
+
Notes:
|
| 11 |
+
|
| 12 |
+
* <bos> is emitted by this template. The shipped tokenizer.json has a ByteLevel
|
| 13 |
+
post-processor, not a TemplateProcessing one, so no BOS is added automatically
|
| 14 |
+
and add_special_tokens has no effect on it.
|
| 15 |
+
|
| 16 |
+
* <eos> is emitted only when the conversation ends on an assistant turn, i.e. when
|
| 17 |
+
the rendered text is a complete training sequence. With add_generation_prompt=True
|
| 18 |
+
it is not emitted, so the model generates the assistant turn itself.
|
| 19 |
+
|
| 20 |
+
* The <|think|> block is optional and is read from the `reasoning_content` field of
|
| 21 |
+
an assistant message (the `think` field is accepted as an alias). The model is
|
| 22 |
+
reasoning-first: it opens the block on its own, so it does not need to be
|
| 23 |
+
prefilled at generation time.
|
| 24 |
+
|
| 25 |
+
* <en>, <ru>, </en>, </ru> and <endofprompt> are never emitted. They exist in the
|
| 26 |
+
vocabulary but were removed from the supervised data.
|
| 27 |
+
|
| 28 |
+
* A non-empty system message is required. The model was supervised with one on every
|
| 29 |
+
example; "You are a helpful assistant." specifically should not be used, it pulls
|
| 30 |
+
the model towards a generic assistant identity.
|
| 31 |
+
-#}
|
| 32 |
+
{{- '<bos>' -}}
|
| 33 |
+
{%- for message in messages -%}
|
| 34 |
+
{%- set content = message['content'] if message['content'] is not none else '' -%}
|
| 35 |
+
{%- if message['role'] == 'system' -%}
|
| 36 |
+
{{- '<im_start><system>' + content + '<im_end>' -}}
|
| 37 |
+
{%- elif message['role'] == 'user' -%}
|
| 38 |
+
{{- '<im_start><user>' + content + '<im_end>' -}}
|
| 39 |
+
{%- elif message['role'] == 'assistant' -%}
|
| 40 |
+
{%- set think = message.get('reasoning_content') or message.get('think') -%}
|
| 41 |
+
{{- '<im_start><assistant>' -}}
|
| 42 |
+
{%- if think -%}
|
| 43 |
+
{{- '<|think|>' + think + '<|/think|>' -}}
|
| 44 |
+
{%- endif -%}
|
| 45 |
+
{{- content + '<im_end>' -}}
|
| 46 |
+
{%- else -%}
|
| 47 |
+
{{- raise_exception('Lissa chat template: unexpected role "' + message['role'] + '"') -}}
|
| 48 |
+
{%- endif -%}
|
| 49 |
+
{%- endfor -%}
|
| 50 |
+
{%- if add_generation_prompt -%}
|
| 51 |
+
{{- '<im_start><assistant>' -}}
|
| 52 |
+
{%- elif messages and messages[-1]['role'] == 'assistant' -%}
|
| 53 |
+
{{- '<eos>' -}}
|
| 54 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"allow_neg_eigval": false,
|
| 3 |
+
"attn": [
|
| 4 |
+
{
|
| 5 |
+
"layers": [
|
| 6 |
+
3,
|
| 7 |
+
7,
|
| 8 |
+
11,
|
| 9 |
+
15,
|
| 10 |
+
19,
|
| 11 |
+
23
|
| 12 |
+
],
|
| 13 |
+
"num_heads": 24,
|
| 14 |
+
"num_kv_heads": 6,
|
| 15 |
+
"qkv_bias": false,
|
| 16 |
+
"rope_theta": 10000.0,
|
| 17 |
+
"window_size": null
|
| 18 |
+
}
|
| 19 |
+
],
|
| 20 |
+
"attn_mode": "chunk",
|
| 21 |
+
"attnres_block_size": 4,
|
| 22 |
+
"bos_token_id": 0,
|
| 23 |
+
"conv_size": 4,
|
| 24 |
+
"eos_token_id": 1,
|
| 25 |
+
"expand_v": 1.0,
|
| 26 |
+
"fuse_cross_entropy": true,
|
| 27 |
+
"fuse_norm": true,
|
| 28 |
+
"fuse_swiglu": true,
|
| 29 |
+
"head_dim": 64,
|
| 30 |
+
"hidden_act": "swish",
|
| 31 |
+
"hidden_ratio": 6.667,
|
| 32 |
+
"hidden_size": 1536,
|
| 33 |
+
"initializer_range": 0.02,
|
| 34 |
+
"intermediate_size": 10240,
|
| 35 |
+
"lower_bound": null,
|
| 36 |
+
"max_position_embeddings": 16384,
|
| 37 |
+
"model_type": "kda",
|
| 38 |
+
"norm_eps": 1e-06,
|
| 39 |
+
"num_heads": 24,
|
| 40 |
+
"num_hidden_layers": 24,
|
| 41 |
+
"num_v_heads": null,
|
| 42 |
+
"pad_token_id": null,
|
| 43 |
+
"safe_gate": false,
|
| 44 |
+
"tie_word_embeddings": false,
|
| 45 |
+
"transformers_version": "5.16.1",
|
| 46 |
+
"use_cache": true,
|
| 47 |
+
"use_l2warp": false,
|
| 48 |
+
"use_short_conv": true,
|
| 49 |
+
"vocab_size": 32768
|
| 50 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 0,
|
| 3 |
+
"eos_token_id": 1,
|
| 4 |
+
"pad_token_id": 1,
|
| 5 |
+
"max_new_tokens": 512,
|
| 6 |
+
"do_sample": true,
|
| 7 |
+
"temperature": 0.6,
|
| 8 |
+
"top_k": 20,
|
| 9 |
+
"top_p": 0.97,
|
| 10 |
+
"repetition_penalty": 1.1,
|
| 11 |
+
"transformers_version": "5.16.1"
|
| 12 |
+
}
|
logo.png
ADDED
|
Git LFS Details
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27b54e40df8074806018a2728b3bdbee844593b2f3667e895487f584336b9eaf
|
| 3 |
+
size 2893538544
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<bos>",
|
| 3 |
+
"eos_token": "<eos>",
|
| 4 |
+
"pad_token": "<eos>",
|
| 5 |
+
"additional_special_tokens": [
|
| 6 |
+
"<|think|>",
|
| 7 |
+
"<|/think|>",
|
| 8 |
+
"<system>",
|
| 9 |
+
"<user>",
|
| 10 |
+
"<assistant>",
|
| 11 |
+
"<en>",
|
| 12 |
+
"<ru>",
|
| 13 |
+
"</en>",
|
| 14 |
+
"</ru>",
|
| 15 |
+
"<endofprompt>",
|
| 16 |
+
"<im_start>",
|
| 17 |
+
"<im_end>",
|
| 18 |
+
"<endoftext>"
|
| 19 |
+
]
|
| 20 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"bos_token": "<bos>",
|
| 5 |
+
"eos_token": "<eos>",
|
| 6 |
+
"pad_token": "<eos>",
|
| 7 |
+
"unk_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"model_max_length": 16384,
|
| 10 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 11 |
+
"chat_template": "{#-\n Lissa 1.5B - chat template (ChatML variant with a reasoning block).\n\n Canonical sequence, as used for the SFT run:\n\n <bos><im_start><system>{system}<im_end>\n <im_start><user>{user}<im_end>\n <im_start><assistant>[<|think|>{think}<|/think|>]{answer}<im_end><eos>\n\n Notes:\n\n * <bos> is emitted by this template. The shipped tokenizer.json has a ByteLevel\n post-processor, not a TemplateProcessing one, so no BOS is added automatically\n and add_special_tokens has no effect on it.\n\n * <eos> is emitted only when the conversation ends on an assistant turn, i.e. when\n the rendered text is a complete training sequence. With add_generation_prompt=True\n it is not emitted, so the model generates the assistant turn itself.\n\n * The <|think|> block is optional and is read from the `reasoning_content` field of\n an assistant message (the `think` field is accepted as an alias). The model is\n reasoning-first: it opens the block on its own, so it does not need to be\n prefilled at generation time.\n\n * <en>, <ru>, </en>, </ru> and <endofprompt> are never emitted. They exist in the\n vocabulary but were removed from the supervised data.\n\n * A non-empty system message is required. The model was supervised with one on every\n example; \"You are a helpful assistant.\" specifically should not be used, it pulls\n the model towards a generic assistant identity.\n-#}\n{{- '<bos>' -}}\n{%- for message in messages -%}\n {%- set content = message['content'] if message['content'] is not none else '' -%}\n {%- if message['role'] == 'system' -%}\n {{- '<im_start><system>' + content + '<im_end>' -}}\n {%- elif message['role'] == 'user' -%}\n {{- '<im_start><user>' + content + '<im_end>' -}}\n {%- elif message['role'] == 'assistant' -%}\n {%- set think = message.get('reasoning_content') or message.get('think') -%}\n {{- '<im_start><assistant>' -}}\n {%- if think -%}\n {{- '<|think|>' + think + '<|/think|>' -}}\n {%- endif -%}\n {{- content + '<im_end>' -}}\n {%- else -%}\n {{- raise_exception('Lissa chat template: unexpected role \"' + message['role'] + '\"') -}}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- '<im_start><assistant>' -}}\n{%- elif messages and messages[-1]['role'] == 'assistant' -%}\n {{- '<eos>' -}}\n{%- endif -%}\n"
|
| 12 |
+
}
|