初始化项目,由ModelHub XC社区提供模型
Model: swiss-ai/Apertus-v1.1-1.5B-Instruct Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||||
217
README.md
Normal file
217
README.md
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
base_model:
|
||||||
|
- swiss-ai/Apertus-v1.1-1.5B
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
library_name: transformers
|
||||||
|
tags:
|
||||||
|
- multilingual
|
||||||
|
- compliant
|
||||||
|
- swiss-ai
|
||||||
|
- apertus
|
||||||
|
|
||||||
|
extra_gated_prompt: "### Apertus LLM Acceptable Use Policy \n(1.0 | September 1, 2025)\n\"Agreement\" The Swiss National AI Institute (SNAI) is a partnership between the two Swiss Federal Institutes of Technology, ETH Zurich and EPFL. \n\nBy using the Apertus LLM you agree to indemnify, defend, and hold harmless ETH Zurich and EPFL against any third-party claims arising from your use of Apertus LLM. \n\nThe training data and the Apertus LLM may contain or generate information that directly or indirectly refers to an identifiable individual (Personal Data). You process Personal Data as independent controller in accordance with applicable data protection law. SNAI will regularly provide a file with hash values for download which you can apply as an output filter to your use of our Apertus LLM. The file reflects data protection deletion requests which have been addressed to SNAI as the developer of the Apertus LLM. It allows you to remove Personal Data contained in the model output. We strongly advise downloading and applying this output filter from SNAI every six months following the release of the model. "
|
||||||
|
extra_gated_fields:
|
||||||
|
Your Name: text
|
||||||
|
Country: country
|
||||||
|
Affiliation: text
|
||||||
|
geo: ip_location
|
||||||
|
By clicking Submit below I accept the terms of use: checkbox
|
||||||
|
extra_gated_button_content: Submit
|
||||||
|
---
|
||||||
|
|
||||||
|
# Apertus-v1.1-1.5B-Instruct
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
1. [Model Summary](#model-summary)
|
||||||
|
2. [How to use](#how-to-use)
|
||||||
|
3. [Evaluation](#evaluation)
|
||||||
|
4. [Training](#training)
|
||||||
|
5. [Limitations](#limitations)
|
||||||
|
6. [Legal Aspects](#legal-aspects)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Model Summary
|
||||||
|
|
||||||
|
Apertus-v1.1 is a series of highly efficient, 0.5-4B billion parameter language models designed to extend the fully-open and compliant Apertus ecosystem to highly constrained hardware environments.
|
||||||
|
|
||||||
|
The models rely on a dense transformer architecture featuring grouped-query attention and xIELU activations.
|
||||||
|
|
||||||
|
Instead of standard pre-training, Apertus-v1.1 models were created using pre-training distillation (PD) from the [Apertus-8B-2509](https://huggingface.co/swiss-ai/Apertus-8B-2509) teacher model. They were trained on 1.7T tokens from Phase 5 of the original Apertus data pipeline—the highest quality tier of filtered documents, code, and instruction samples without introducing any new data sources or licenses. Post-training included supervised fine-tuning (SFT) and alignment similar to that of the original Apertus.
|
||||||
|
|
||||||
|
### Key features
|
||||||
|
- **Fully open model**: open weights + open data + full training details including all data and training recipes
|
||||||
|
- **Massively Multilingual**: 1811 natively supported languages
|
||||||
|
- **Compliant** Apertus is trained while respecting opt-out consent of data owners (even retrospectively), and avoiding memorization of training data
|
||||||
|
- **Cost-Effective Distillation**: Trained using a 90%/10% mix of KL-Divergence and label cross-entropy derived from the 8B teacher model, drastically reducing the required compute.
|
||||||
|
- **Hardware Optimized**: Specifically optimized for memory-limited scenarios like mobile and edge deployments, with quantized checkpoints available for Apple devices (MLX) in INT2, INT3, INT4, and INT6 formats.
|
||||||
|
|
||||||
|
### Quantized Checkpoints
|
||||||
|
|
||||||
|
This model family includes base pre-trained models and instruction-tuned models.
|
||||||
|
|
||||||
|
For instruction-tuned models, we additionally provide high-quality quantization-aware distillation (QAD) checkpoints, obtained via the official [`qat-suite`](https://github.com/swiss-ai/qat-suite). We provide FP8 and NVFP4A16 checkpoints with vLLM inference in mind and INT3-6 checkpoints optimized for mobile usage on Apple devices.
|
||||||
|
|
||||||
|
The full list of released checkpoints is shown below:
|
||||||
|
|
||||||
|
| | BF16 | BF16 | FP8 | NVFP4A16 | INT3 | INT4 | INT6 |
|
||||||
|
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
||||||
|
| | Base | Instruct | Instruct | Instruct | Instruct | Instruct | Instruct |
|
||||||
|
| **0.5B** | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct-vLLM-FP8) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct-vLLM-NVFP4A16) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct-MLX-INT3) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct-MLX-INT4) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-0.5B-Instruct-MLX-INT6) |
|
||||||
|
| **1.5B** | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct-vLLM-FP8) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct-vLLM-NVFP4A16) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct-MLX-INT3) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct-MLX-INT4) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-1.5B-Instruct-MLX-INT6) |
|
||||||
|
| **4B** | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct-vLLM-FP8) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct-vLLM-NVFP4A16) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct-MLX-INT3) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct-MLX-INT4) | [✅](https://huggingface.co/swiss-ai/Apertus-v1.1-4B-Instruct-MLX-INT6) |
|
||||||
|
| **8B** | [✅](https://huggingface.co/swiss-ai/Apertus-8B-2509) | [✅](https://huggingface.co/swiss-ai/Apertus-8B-Instruct-2509) | [✅](https://huggingface.co/swiss-ai/Apertus-8B-Instruct-2509-vLLM-FP8) | [✅](https://huggingface.co/swiss-ai/Apertus-8B-Instruct-2509-vLLM-NVFP4A16) | ❌ | [✅](https://huggingface.co/swiss-ai/Apertus-8B-Instruct-2509-MLX-INT4) | ❌ |
|
||||||
|
|
||||||
|
|
||||||
|
For more details refer to the original Apertus [technical report](https://arxiv.org/abs/2509.14233) and the new Apertus [distillation technical report](https://arxiv.org/abs/2605.29128).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
The modeling code for Apertus is available in transformers `v4.56.0` and later, so make sure to upgrade your transformers version. You can also load the model with the latest `vLLM` which uses transformers as a backend.
|
||||||
|
```bash
|
||||||
|
pip install -U transformers
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
|
||||||
|
model_name = "swiss-ai/Apertus-v1.1-1.5B-Instruct"
|
||||||
|
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
||||||
|
|
||||||
|
# load the tokenizer and the model
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(
|
||||||
|
model_name,
|
||||||
|
).to(device)
|
||||||
|
|
||||||
|
# prepare the model input
|
||||||
|
prompt = "Give me a brief explanation of gravity in simple terms."
|
||||||
|
messages_think = [
|
||||||
|
{"role": "user", "content": prompt}
|
||||||
|
]
|
||||||
|
|
||||||
|
text = tokenizer.apply_chat_template(
|
||||||
|
messages_think,
|
||||||
|
tokenize=False,
|
||||||
|
add_generation_prompt=True,
|
||||||
|
)
|
||||||
|
model_inputs = tokenizer([text], return_tensors="pt", add_special_tokens=False).to(model.device)
|
||||||
|
|
||||||
|
# Generate the output
|
||||||
|
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
|
||||||
|
|
||||||
|
# Get and decode the output
|
||||||
|
output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]
|
||||||
|
print(tokenizer.decode(output_ids, skip_special_tokens=True))
|
||||||
|
```
|
||||||
|
|
||||||
|
>[!TIP]
|
||||||
|
> We recommend setting `temperature=0.8` and `top_p=0.9` in the sampling parameters.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Evaluation
|
||||||
|
|
||||||
|
**Post-Training Multilingual Evaluation:** Performance of the Apertus-v1.1 models across multilingual benchmarks compared to models in similar size classes.
|
||||||
|
|
||||||
|
| *Model* | *Average* | MMLU | TruthfulQA | Arc | IF | LogiQA |
|
||||||
|
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
|
||||||
|
| **Apertus-v1.1-0.5B-Instruct** | 0.318 | 0.258 | 0.461 | 0.225 | 0.328 | 0.279 |
|
||||||
|
| **Apertus-v1.1-1.5B-Instruct** | 0.382 | 0.377 | 0.451 | 0.266 | 0.434 | 0.276 |
|
||||||
|
| **Apertus-v1.1-4B-Instruct** | 0.473 | 0.504 | 0.506 | 0.332 | 0.550 | 0.296 |
|
||||||
|
| **Apertus-8B-Instruct-2509** | 0.534 | 0.553 | 0.524 | 0.368 | 0.689 | 0.290 |
|
||||||
|
| EuroLLM-1.7B-Instruct | 0.291 | 0.260 | 0.433 | 0.250 | 0.222 | 0.269 |
|
||||||
|
| EuroLLM-9B-Instruct | 0.480 | 0.520 | 0.465 | 0.322 | 0.613 | 0.345 |
|
||||||
|
| gemma-3-270m-it | 0.289 | 0.242 | 0.465 | 0.215 | 0.236 | 0.205 |
|
||||||
|
| gemma-3-1b-it | 0.406 | 0.409 | 0.457 | 0.250 | 0.509 | 0.379 |
|
||||||
|
| gemma-3-4b-it | 0.497 | 0.547 | 0.492 | 0.316 | 0.635 | 0.411 |
|
||||||
|
| SmolLM2-1.7B-Instruct | 0.348 | 0.365 | 0.452 | 0.213 | 0.364 | 0.246 |
|
||||||
|
| SmolLM3-3B | 0.479 | 0.507 | 0.500 | 0.270 | 0.637 | 0.365 |
|
||||||
|
| Qwen3-0.6B | 0.401 | 0.377 | 0.464 | 0.222 | 0.541 | 0.353 |
|
||||||
|
| Qwen3-1.7B | 0.457 | 0.477 | 0.490 | 0.251 | 0.611 | 0.414 |
|
||||||
|
| Qwen3-4B | 0.521 | 0.581 | 0.497 | 0.274 | 0.733 | 0.500 |
|
||||||
|
|
||||||
|
While Apertus-v1.1 demonstrates competitive baseline multilingual chatting performance, it may lack in specific capabilities such as advanced math and complex instruction following.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Training
|
||||||
|
|
||||||
|
### Model Architecture
|
||||||
|
|
||||||
|
**Apertus-v1.1-1.5B**
|
||||||
|
|
||||||
|
* **Architecture Type:** Dense transformer decoder with grouped-query attention.
|
||||||
|
* **Layers:** 16.
|
||||||
|
* **Model Dimension:** 2048.
|
||||||
|
* **MLP Dimension:** 12288.
|
||||||
|
* **Heads (Q/KV):** 32/8.
|
||||||
|
* **Tied Embeddings:** No.
|
||||||
|
* **Activation Function:** xIELU.
|
||||||
|
* **Compute / Storage Size:** 1.5B/2.0B parameters.
|
||||||
|
|
||||||
|
### Pre-Training Details
|
||||||
|
|
||||||
|
* **Training Tokens:** 1.7T.
|
||||||
|
* **Optimizer:** AdEMAMix with WSD schedule and weight decay.
|
||||||
|
* **Sequence Handling:** Documents packed into chunks of 4096 tokens with cross-document attention masked.
|
||||||
|
* **Total Compute:** 0.8E22 FLOPs.
|
||||||
|
|
||||||
|
### Software & hardware
|
||||||
|
|
||||||
|
- **GPUs:** 64 GH200
|
||||||
|
- **Pre-Training Distillation Framework:** [Megatron-LM](https://github.com/swiss-ai/Megatron-LM-Distill)
|
||||||
|
- **Post-Training Framework:** [posttraining](https://github.com/swiss-ai/posttraining)
|
||||||
|
- **Quantization Suite:** [qat-suite](https://github.com/swiss-ai/qat-suite)
|
||||||
|
|
||||||
|
### Open resources
|
||||||
|
All elements used in the training process are made openly available
|
||||||
|
- **Training data reconstruction scripts:** [github.com/swiss-ai/pretrain-data](https://github.com/swiss-ai/pretrain-data)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
Apertus can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Legal Aspects
|
||||||
|
|
||||||
|
The Apertus-v1.1 fully reuses the data of the original Apertus release, meaning the original data summary is representative of this release as well.
|
||||||
|
|
||||||
|
#### EU AI Act Transparency Documentation and Code of Practice
|
||||||
|
- [Apertus_EU_Public_Summary.pdf](https://huggingface.co/swiss-ai/Apertus-70B-2509/blob/main/Apertus_EU_Public_Summary.pdf)
|
||||||
|
- [Apertus_EU_Code_of_Practice.pdf](https://huggingface.co/swiss-ai/Apertus-70B-2509/blob/main/Apertus_EU_Code_of_Practice.pdf)
|
||||||
|
|
||||||
|
#### Data Protection and Copyright Requests
|
||||||
|
For removal requests of personally identifiable information (PII) or of copyrighted content, please contact the respective dataset owners or us directly
|
||||||
|
- llm-privacy-requests@swiss-ai.org
|
||||||
|
- llm-copyright-requests@swiss-ai.org
|
||||||
|
|
||||||
|
#### Output Filter for PII
|
||||||
|
- Currently no output filter is provided.
|
||||||
|
- Please check this site regularly for an output filter that can be used on top of the Apertus LLM. The filter reflects data protection deletion requests which have been addressed to us as the developer of the Apertus LLM. It allows you to remove Personal Data contained in the model output. We strongly advise downloading and applying this output filter from this site every six months.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
To contact us, please send an email to
|
||||||
|
llm-requests@swiss-ai.org
|
||||||
|
|
||||||
|
## Citation
|
||||||
|
```bash
|
||||||
|
@misc{panferov2026apertusllmfamilyexpansion,
|
||||||
|
title={Apertus LLM Family Expansion via Distillation and Quantization},
|
||||||
|
author={Andrei Panferov and Davit Melikidze and Martin Jaggi and Dan Alistarh},
|
||||||
|
year={2026},
|
||||||
|
eprint={2605.29128},
|
||||||
|
archivePrefix={arXiv},
|
||||||
|
primaryClass={cs.LG},
|
||||||
|
url={[https://arxiv.org/abs/2605.29128](https://arxiv.org/abs/2605.29128)},
|
||||||
|
}
|
||||||
|
```
|
||||||
5
chat_template.jinja
Normal file
5
chat_template.jinja
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{{ bos_token }}{%- set system_token = '<SPECIAL_61>' -%}{%- set end_system_token = '<SPECIAL_62>' -%}{%- set developer_token = '<SPECIAL_63>' -%}{%- set end_developer_token = '<SPECIAL_64>' -%}{%- set user_token = '<SPECIAL_65>' -%}{%- set end_user_token = '<SPECIAL_66>' -%}{%- set assistant_token = '<SPECIAL_67>' -%}{%- set end_assistant_token = '<SPECIAL_68>' -%}{%- set inner_token = '<SPECIAL_69>' -%}{%- set outer_token = '<SPECIAL_70>' -%}{%- set tool_calls_token = '<SPECIAL_71>' -%}{%- set end_tool_calls_token = '<SPECIAL_72>' -%}{%- if messages and messages[0].role == 'system' -%} {%- set system_content = messages[0].content -%} {{ system_token }} {%- if system_content is string -%} {{ system_content }} {%- elif system_content is mapping and "text" in system_content -%} {{ system_content.text }} {%- else -%} {{- raise_exception("Invalid system content: " + str(system_content)) -}} {%- endif -%} {{ end_system_token }} {%- set messages_without_system = messages[1:] -%}{%- else -%} {{ system_token + end_system_token }} {%- set messages_without_system = messages -%}{%- endif -%}{%- if messages_without_system and messages_without_system[0].role == 'developer' -%} {%- set developer_content = messages_without_system[0].content -%} {{ developer_token }} {%- if "has_thinking" in developer_content -%} {{ 'Deliberation: ' }} {%- if developer_content.has_thinking -%} {{ 'enabled' }} {%- else -%} {{ 'disabled' }} {%- endif -%} {{ '
|
||||||
|
' }} {%- else -%} {{ 'Deliberation: disabled
|
||||||
|
' }} {%- endif -%} {%- if "formatted_tools" in developer_content and developer_content.formatted_tools -%} {{ 'Tool Capabilities:
|
||||||
|
' + developer_content.formatted_tools }} {%- else -%} {{ 'Tool Capabilities: disabled' }} {%- endif -%} {{ end_developer_token }} {%- set loop_messages = messages_without_system[1:] -%}{%- else -%} {{ developer_token + 'Deliberation: disabled
|
||||||
|
Tool Capabilities: disabled' + end_developer_token }} {%- set loop_messages = messages_without_system -%}{%- endif -%}{%- for message in loop_messages -%} {%- set content = message.content -%} {%- if message.role == 'user' -%} {{ user_token }} {%- if content is string -%} {{ content }} {%- elif content is sequence -%} {%- for part in content.parts -%} {%- if part.type == 'text' -%} {{ part.text }} {%- endif -%} {%- endfor -%} {%- else -%} {{- raise_exception("Invalid user content: " + str(content)) -}} {%- endif -%} {{ end_user_token }} {%- elif message.role == 'assistant' -%} {{ assistant_token }} {%- if content is string -%} {{ content }} {%- elif content is sequence -%} {%- set ns = namespace(in_inner=false) -%} {%- for block in content.blocks -%} {%- if block.type == 'thoughts' -%} {%- if not ns.in_inner -%} {%- set ns.in_inner = true -%} {{ inner_token }} {%- endif -%} {{ block.text }} {%- elif block.type == 'tool_calls' -%} {%- if ns.in_inner and not loop.first and block.calls|length == 1 and block.calls[0].name == 'display_answers' -%} {%- set ns.in_inner = false -%} {{ outer_token }} {%- endif -%} {{ tool_calls_token + '[' }} {%- for tool_call in block.calls -%} {{- '{"' + tool_call.name + '": ' + tool_call.arguments + '}' }} {%- if not loop.last -%} {{- ", " }} {%- endif -%} {%- endfor -%} {{ ']' + end_tool_calls_token }} {%- elif block.type == 'tool_outputs' -%} {{ '[' }} {%- for tool_output in block.outputs -%} {{- tool_output.output }} {%- if not loop.last -%} {{- ", " }} {%- endif -%} {%- endfor -%} {{- ']' }} {%- if not loop.last -%} {{- ' ' }} {%- endif -%} {%- elif block.type == 'response' -%} {%- if not loop.first and ns.in_inner -%} {%- set ns.in_inner = false -%} {{ outer_token }} {%- endif -%} {{ block.text }} {%- else -%} {{- raise_exception("Invalid block type: " + block.type) -}} {%- endif -%} {%- endfor -%} {%- else -%} {{- raise_exception("Invalid assistant content: " + str(content)) -}} {%- endif -%} {{ end_assistant_token }} {%- else -%} {{- raise_exception("Invalid message role: " + message.role) -}} {%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%} {{ assistant_token }}{%- endif -%}
|
||||||
37
config.json
Normal file
37
config.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"ApertusForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"dtype": "bfloat16",
|
||||||
|
"eos_token_id": 68,
|
||||||
|
"hidden_act": "xielu",
|
||||||
|
"hidden_dropout": 0.0,
|
||||||
|
"hidden_size": 2048,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 12288,
|
||||||
|
"max_position_embeddings": 4096,
|
||||||
|
"mlp_bias": false,
|
||||||
|
"model_type": "apertus",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_hidden_layers": 16,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"pad_token_id": 10,
|
||||||
|
"post_norm": false,
|
||||||
|
"qk_norm": true,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_parameters": {
|
||||||
|
"rope_theta": 500000.0,
|
||||||
|
"rope_type": "default"
|
||||||
|
},
|
||||||
|
"rope_scaling": {
|
||||||
|
"rope_type": "default"
|
||||||
|
},
|
||||||
|
"rope_theta": 500000.0,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"transformers_version": "4.57.6",
|
||||||
|
"use_cache": false,
|
||||||
|
"vocab_size": 131072
|
||||||
|
}
|
||||||
9
generation_config.json
Normal file
9
generation_config.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": [
|
||||||
|
68
|
||||||
|
],
|
||||||
|
"pad_token_id": 10,
|
||||||
|
"transformers_version": "4.57.6"
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:963ab9667a5b8326b2bf794042686c46b7c78da31b4995b27ce6edbdba9731ba
|
||||||
|
size 3020063528
|
||||||
30
special_tokens_map.json
Normal file
30
special_tokens_map.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<SPECIAL_68>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "<pad>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:be12f4375d655cc740864e3a9041bcddd8477942f209d9e7f27f6c8767162638
|
||||||
|
size 17078368
|
||||||
8020
tokenizer_config.json
Normal file
8020
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user