Upload intellix-oQ8 via oMLX
Browse files- .gitattributes +1 -0
- README.md +215 -0
- chat_template.jinja +155 -0
- config.json +31 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +33 -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 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
base_model: mediusware/intellix-foundation
|
| 5 |
+
model_type: intellix
|
| 6 |
+
tags:
|
| 7 |
+
- business-ai
|
| 8 |
+
- mediusware
|
| 9 |
+
- proprietary
|
| 10 |
+
- sft
|
| 11 |
+
- transformers
|
| 12 |
+
- lora
|
| 13 |
+
- gguf
|
| 14 |
+
- business-intelligence
|
| 15 |
+
- office-automation
|
| 16 |
+
- security-focused
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
<p align="center">
|
| 20 |
+
<img src="https://huggingface.co/mediusware-ai/intellix/resolve/main/logo.png" width="800">
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
# Model Card: mw-intellix
|
| 24 |
+
|
| 25 |
+
**mw-intellix** is a high-capacity, fine-tuned large language model (LLM) designed specifically for enterprise-grade applications. It addresses the critical need for secure, accurate, and professional AI in the business world (B2B). Developed by **[Mediusware](https://mediusware.com)**, it offers a state-of-the-art solution that prioritizes data privacy and professional reasoning.
|
| 26 |
+
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
## 1. Model Details
|
| 30 |
+
|
| 31 |
+
- **Model Developer:** Mediusware
|
| 32 |
+
- **Model Date:** March 2026
|
| 33 |
+
- **Model Version:** 1.0.0
|
| 34 |
+
- **Model Type:** Causal Language Model (Fine-tuned via PEFT/LoRA and GGUF quantized)
|
| 35 |
+
- **Base Model:** Proprietary Business-Oriented Foundation (Optimized Qwen architecture)
|
| 36 |
+
- **License:** Proprietary (Mediusware)
|
| 37 |
+
|
| 38 |
+
## 2. Intended Use
|
| 39 |
+
|
| 40 |
+
### Primary Intended Uses
|
| 41 |
+
- **Enterprise Communication:** Drafting professional emails, client updates, and internal memos.
|
| 42 |
+
- **Policy & Security Auditing:** Generating and reviewing business security policies and compliance documentation.
|
| 43 |
+
- **Knowledge Synthesis:** Summarizing complex business documents into executive highlights.
|
| 44 |
+
- **Decision Support:** Providing reasoned insights for project management and business logic.
|
| 45 |
+
|
| 46 |
+
### Primary Intended Users
|
| 47 |
+
- Business professionals and executives.
|
| 48 |
+
- IT security and compliance officers.
|
| 49 |
+
- Enterprise software developers integrating AI into professional workflows.
|
| 50 |
+
|
| 51 |
+
### Out-of-Scope Use Cases
|
| 52 |
+
- Non-professional or casual conversational use.
|
| 53 |
+
- High-stakes medical, legal, or financial advice without human oversight.
|
| 54 |
+
- Generation of fictional or creative content not grounded in business reality.
|
| 55 |
+
|
| 56 |
+
## 3. Factors
|
| 57 |
+
|
| 58 |
+
### Relevant Factors
|
| 59 |
+
- **Professional Tone:** The model is evaluated based on its ability to maintain a consistent, corporate-ready voice.
|
| 60 |
+
- **Security Compliance:** Evaluation focuses on the model's adherence to security protocols and data privacy constraints.
|
| 61 |
+
- **Accuracy:** Minimization of hallucinations in professional contexts (e.g., policy drafting).
|
| 62 |
+
|
| 63 |
+
### Evaluation
|
| 64 |
+
Evaluations were conducted using a proprietary enterprise benchmark suite and real-world business scenarios to ensure the model's readiness for B2B deployment.
|
| 65 |
+
|
| 66 |
+
## 4. Metrics
|
| 67 |
+
|
| 68 |
+
### Model Performance Measures
|
| 69 |
+
- **Throughput:** Measured in tokens per second (TPS) for real-time responsiveness.
|
| 70 |
+
- **Latency:** Time-to-first-token (TTFT) and total response time.
|
| 71 |
+
- **Persona Adherence:** Qualitative and quantitative scoring of professional tone consistency.
|
| 72 |
+
|
| 73 |
+
## 5. Evaluation Results
|
| 74 |
+
|
| 75 |
+
### Quantitative Performance (March 2026)
|
| 76 |
+
*Tested on Q8_0 GGUF via optimized local inference.*
|
| 77 |
+
|
| 78 |
+
| Metric | Performance Value |
|
| 79 |
+
| :--- | :--- |
|
| 80 |
+
| **Average Throughput** | **196.08 tokens/sec** |
|
| 81 |
+
| **Average Latency** | **0.68 seconds** |
|
| 82 |
+
| **Peak Throughput** | **199.48 tokens/sec** |
|
| 83 |
+
| **Model Footprint** | **2.0 GB** |
|
| 84 |
+
|
| 85 |
+
## 6. Training Data
|
| 86 |
+
|
| 87 |
+
### Data Sources
|
| 88 |
+
The model was fine-tuned on a massive, curated dataset including:
|
| 89 |
+
- Professional business correspondence and templates.
|
| 90 |
+
- Industry-standard security policies and compliance manuals.
|
| 91 |
+
- Technical documentation for enterprise software.
|
| 92 |
+
- High-quality project management logs and reports.
|
| 93 |
+
|
| 94 |
+
### Data Preprocessing
|
| 95 |
+
Data was rigorously cleaned to remove PII (Personally Identifiable Information) and informal/low-quality text, ensuring the model's output remains strictly professional.
|
| 96 |
+
|
| 97 |
+
## 7. Quantitative Analysis
|
| 98 |
+
|
| 99 |
+
### Benchmark Scenarios
|
| 100 |
+
The following scenarios were used to validate the model's business intelligence:
|
| 101 |
+
1. **Scenario A:** Draft a secure data handling policy for a fintech startup.
|
| 102 |
+
2. **Scenario B:** Summarize a 50-page internal audit report into 5 key action items.
|
| 103 |
+
3. **Scenario C:** Write a professional apology to a high-value client for a project delay.
|
| 104 |
+
|
| 105 |
+
## 8. Fine-Tuning Process
|
| 106 |
+
|
| 107 |
+
### Methodology
|
| 108 |
+
**mw-intellix** was fine-tuned using the **Unsloth** library for memory-efficient and fast training. The process utilized **LoRA (Low-Rank Adaptation)** to adapt the base architecture to specialized business domains without compromising the model's general intelligence.
|
| 109 |
+
|
| 110 |
+
### Hyperparameters
|
| 111 |
+
The following hyperparameters were used during the fine-tuning phase:
|
| 112 |
+
|
| 113 |
+
| Parameter | Value |
|
| 114 |
+
| :--- | :--- |
|
| 115 |
+
| **PEFT Type** | LoRA |
|
| 116 |
+
| **LoRA Rank (r)** | 16 |
|
| 117 |
+
| **LoRA Alpha** | 16 |
|
| 118 |
+
| **LoRA Dropout** | 0.0 |
|
| 119 |
+
| **Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
|
| 120 |
+
| **Precision** | bfloat16 |
|
| 121 |
+
| **Optimizer** | AdamW |
|
| 122 |
+
| **Learning Rate** | 2e-4 |
|
| 123 |
+
| **Epochs** | 3 |
|
| 124 |
+
|
| 125 |
+
### Hardware Requirements
|
| 126 |
+
- **Training:** Single A100 (40GB) or H100 (80GB) recommended. Suitable for consumer GPUs like RTX 3090/4090 using Unsloth 4-bit loading.
|
| 127 |
+
- **Inference:** Minimum 8GB VRAM (Full) / 2GB VRAM (Q8_0 GGUF).
|
| 128 |
+
|
| 129 |
+
## 9. How to Fine-Tune This Model
|
| 130 |
+
|
| 131 |
+
If you wish to further adapt **mw-intellix** to your specific organizational data, follow these steps:
|
| 132 |
+
|
| 133 |
+
1. **Install Dependencies:**
|
| 134 |
+
```bash
|
| 135 |
+
pip install unsloth "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
| 136 |
+
pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
2. **Load Model with Unsloth:**
|
| 140 |
+
```python
|
| 141 |
+
from unsloth import FastLanguageModel
|
| 142 |
+
import torch
|
| 143 |
+
|
| 144 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 145 |
+
model_name = "mediusware-ai/intellix",
|
| 146 |
+
max_seq_length = 4096,
|
| 147 |
+
load_in_4bit = True,
|
| 148 |
+
)
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
3. **Apply LoRA Adapters:**
|
| 152 |
+
```python
|
| 153 |
+
model = FastLanguageModel.get_peft_model(
|
| 154 |
+
model,
|
| 155 |
+
r = 16,
|
| 156 |
+
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
|
| 157 |
+
"gate_proj", "up_proj", "down_proj"],
|
| 158 |
+
lora_alpha = 16,
|
| 159 |
+
lora_dropout = 0,
|
| 160 |
+
bias = "none",
|
| 161 |
+
)
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
4. **Train on Your Data:**
|
| 165 |
+
Use the `SFTTrainer` from the `trl` library to train on your curated business datasets.
|
| 166 |
+
|
| 167 |
+
---
|
| 168 |
+
|
| 169 |
+
## 10. Ethical Considerations
|
| 170 |
+
|
| 171 |
+
### Data Privacy
|
| 172 |
+
Designed for **Local-First Deployment**. When used via Ollama or GGUF, business data never leaves the local infrastructure, ensuring 100% data residency and privacy.
|
| 173 |
+
|
| 174 |
+
### Safety Guardrails
|
| 175 |
+
- **Professionalism Filter:** Fine-tuned to avoid informal, casual, or inappropriate language.
|
| 176 |
+
- **Hallucination Mitigation:** Specialized training to prioritize "I don't know" or factual grounding over creative extrapolation in sensitive business contexts.
|
| 177 |
+
|
| 178 |
+
## 9. Caveats and Recommendations
|
| 179 |
+
|
| 180 |
+
- **Human-in-the-loop:** While highly accurate, users should always review critical business outputs (e.g., security policies) before implementation.
|
| 181 |
+
- **Language Bias:** Optimized primarily for Business English; performance in other languages may vary.
|
| 182 |
+
|
| 183 |
+
---
|
| 184 |
+
|
| 185 |
+
## How to Get Started
|
| 186 |
+
|
| 187 |
+
### Using with Transformers (PEFT)
|
| 188 |
+
```python
|
| 189 |
+
from peft import PeftModel
|
| 190 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 191 |
+
|
| 192 |
+
model_id = "mediusware-ai/intellix"
|
| 193 |
+
model = AutoModelForCausalLM.from_pretrained("base-model-path")
|
| 194 |
+
model = PeftModel.from_pretrained(model, model_id)
|
| 195 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 196 |
+
|
| 197 |
+
inputs = tokenizer("Draft a professional email regarding project updates.", return_tensors="pt")
|
| 198 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 199 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
### Using with Ollama (GGUF)
|
| 203 |
+
```bash
|
| 204 |
+
ollama run hf.co/mediusware-ai/intellix:Q8_0
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
---
|
| 208 |
+
|
| 209 |
+
### Contact & Support
|
| 210 |
+
For custom enterprise deployments or inquiries, visit **[mediusware.com](https://mediusware.com)**.
|
| 211 |
+
|
| 212 |
+
### Framework Versions
|
| 213 |
+
- PEFT 0.18.1
|
| 214 |
+
- Transformers 4.49.0
|
| 215 |
+
- PyTorch 2.4.0
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
+
{{- '<|im_start|>system\n' }}
|
| 47 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 48 |
+
{%- for tool in tools %}
|
| 49 |
+
{{- "\n" }}
|
| 50 |
+
{{- tool | tojson }}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{{- "\n</tools>" }}
|
| 53 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 54 |
+
{%- if messages[0].role == 'system' %}
|
| 55 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 56 |
+
{%- if content %}
|
| 57 |
+
{{- '\n\n' + content }}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<|im_end|>\n' }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if messages[0].role == 'system' %}
|
| 63 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 64 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 68 |
+
{%- for message in messages[::-1] %}
|
| 69 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 70 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 71 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 72 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 73 |
+
{%- set ns.multi_step_tool = false %}
|
| 74 |
+
{%- set ns.last_query_index = index %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{%- endfor %}
|
| 78 |
+
{%- if ns.multi_step_tool %}
|
| 79 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- for message in messages %}
|
| 82 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
+
{%- if message.role == "system" %}
|
| 84 |
+
{%- if not loop.first %}
|
| 85 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- elif message.role == "user" %}
|
| 88 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 89 |
+
{%- elif message.role == "assistant" %}
|
| 90 |
+
{%- set reasoning_content = '' %}
|
| 91 |
+
{%- if message.reasoning_content is string %}
|
| 92 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{%- if '</think>' in content %}
|
| 95 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 96 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endif %}
|
| 99 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if tool_call.function is defined %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if loop.first %}
|
| 111 |
+
{%- if content|trim %}
|
| 112 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 113 |
+
{%- else %}
|
| 114 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- else %}
|
| 117 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
+
{%- endif %}
|
| 119 |
+
{%- if tool_call.arguments is mapping %}
|
| 120 |
+
{%- for args_name in tool_call.arguments %}
|
| 121 |
+
{%- set args_value = tool_call.arguments[args_name] %}
|
| 122 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 123 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 124 |
+
{{- args_value }}
|
| 125 |
+
{{- '\n</parameter>\n' }}
|
| 126 |
+
{%- endfor %}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '</function>\n</tool_call>' }}
|
| 129 |
+
{%- endfor %}
|
| 130 |
+
{%- endif %}
|
| 131 |
+
{{- '<|im_end|>\n' }}
|
| 132 |
+
{%- elif message.role == "tool" %}
|
| 133 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 134 |
+
{{- '<|im_start|>user' }}
|
| 135 |
+
{%- endif %}
|
| 136 |
+
{{- '\n<tool_response>\n' }}
|
| 137 |
+
{{- content }}
|
| 138 |
+
{{- '\n</tool_response>' }}
|
| 139 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 140 |
+
{{- '<|im_end|>\n' }}
|
| 141 |
+
{%- elif loop.last %}
|
| 142 |
+
{{- '<|im_end|>\n' }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{%- else %}
|
| 145 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 146 |
+
{%- endif %}
|
| 147 |
+
{%- endfor %}
|
| 148 |
+
{%- if add_generation_prompt %}
|
| 149 |
+
{{- '<|im_start|>assistant\n' }}
|
| 150 |
+
{%- if enable_thinking is defined and enable_thinking is true %}
|
| 151 |
+
{{- '<think>\n' }}
|
| 152 |
+
{%- else %}
|
| 153 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 154 |
+
{%- endif %}
|
| 155 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"IntellixForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "intellix",
|
| 6 |
+
"base_model_name_or_path": "mediusware/intellix-foundation",
|
| 7 |
+
"hidden_size": 2048,
|
| 8 |
+
"intermediate_size": 11008,
|
| 9 |
+
"max_position_embeddings": 262144,
|
| 10 |
+
"num_attention_heads": 16,
|
| 11 |
+
"num_hidden_layers": 28,
|
| 12 |
+
"num_key_value_heads": 2,
|
| 13 |
+
"rms_norm_eps": 1e-06,
|
| 14 |
+
"rope_scaling": null,
|
| 15 |
+
"tie_word_embeddings": false,
|
| 16 |
+
"torch_dtype": "bfloat16",
|
| 17 |
+
"transformers_version": "4.49.0",
|
| 18 |
+
"use_cache": true,
|
| 19 |
+
"vocab_size": 151936,
|
| 20 |
+
"eos_token_id": 248046,
|
| 21 |
+
"quantization": {
|
| 22 |
+
"group_size": 64,
|
| 23 |
+
"bits": 8,
|
| 24 |
+
"mode": "affine"
|
| 25 |
+
},
|
| 26 |
+
"quantization_config": {
|
| 27 |
+
"group_size": 64,
|
| 28 |
+
"bits": 8,
|
| 29 |
+
"mode": "affine"
|
| 30 |
+
}
|
| 31 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f6fa5470a8b522f3eb43562903e8623fde4ccf5043f9822b83cd689d669e7fe
|
| 3 |
+
size 17750312
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
|
| 3 |
+
size 19989343
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": false,
|
| 13 |
+
"model_max_length": 262144,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"audio_bos_token": "<|audio_start|>",
|
| 16 |
+
"audio_eos_token": "<|audio_end|>",
|
| 17 |
+
"audio_token": "<|audio_pad|>",
|
| 18 |
+
"image_token": "<|image_pad|>",
|
| 19 |
+
"video_token": "<|video_pad|>",
|
| 20 |
+
"vision_bos_token": "<|vision_start|>",
|
| 21 |
+
"vision_eos_token": "<|vision_end|>"
|
| 22 |
+
},
|
| 23 |
+
"pad_token": "<|vision_pad|>",
|
| 24 |
+
"padding_side": "right",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "IntellixProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "TokenizersBackend",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|