初始化项目,由ModelHub XC社区提供模型

Model: QuantaSparkLabs/Antiplex-instruct-3B
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-25 22:26:24 +08:00
commit b8555a8c3a
14 changed files with 277908 additions and 0 deletions

35
.gitattributes vendored Normal file
View File

@@ -0,0 +1,35 @@
*.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

457
README.md Normal file
View File

@@ -0,0 +1,457 @@
---
language:
- en
license: apache-2.0
pipeline_tag: text-generation
library_name: transformers
tags:
- llm
- instruction-tuned
- text-generation
- conversational
- open-world
- web-search
- anti-tic
- warm-personality
- lora
- lightweight
- safetensors
- causal-lm
- phi3
base_model: unsloth/Phi-3-mini-4k-instruct-bnb-4bit
fine_tuned_from: unsloth/Phi-3-mini-4k-instruct-bnb-4bit
organization: QuantaSparkLabs
model_type: causal-lm
model-index:
- name: Antiplex-Instruct-3B
results:
- task:
type: text-generation
name: Conversational Quality
dataset:
name: antiplex-eval-set
type: Custom
metrics:
- name: AntiTic Success Rate
type: accuracy
value: 1.0
verified: false
- name: Factual Accuracy
type: accuracy
value: 0.85
verified: false
- name: Coherence Score
type: accuracy
value: 0.88
verified: false
- name: Conversational Warmth
type: accuracy
value: 0.90
verified: false
- task:
type: text-generation
name: Grammar & Spelling
dataset:
name: antiplex-eval-set
type: Custom
metrics:
- name: Grammar Accuracy
type: accuracy
value: 0.92
verified: false
- task:
type: text-generation
name: RealWorld Test Suite
dataset:
name: QuantaSparkLabs/antiplex-test-suite
type: Custom
metrics:
- name: AntiTic Success Rate
type: accuracy
value: 1.0
verified: false
note: "Manual evaluation on antiplex-test-suite"
- name: Factual Accuracy
type: accuracy
value: 0.85
verified: false
note: "Manual evaluation on antiplex-test-suite"
- name: Coherence Score
type: accuracy
value: 0.88
verified: false
note: "Manual evaluation on antiplex-test-suite"
- task:
type: text-generation
name: Open LLM Leaderboard
dataset:
name: open-llm-leaderboard
type: benchmark
metrics:
- name: MMLU (5-shot)
type: accuracy
value: 0.0
verified: false
note: "Pending — submit to Open LLM Leaderboard"
- name: HellaSwag (10-shot)
type: accuracy
value: 0.0
verified: false
note: "Pending — submit to Open LLM Leaderboard"
- name: TruthfulQA (0-shot)
type: accuracy
value: 0.0
verified: false
note: "Pending — submit to Open LLM Leaderboard"
- name: ARC (25-shot)
type: accuracy
value: 0.0
verified: false
note: "Pending — submit to Open LLM Leaderboard"
---
<p align="center">
<img src="https://huggingface.co/QuantaSparkLabs/NYXIS-Pro/resolve/main/preview imgagee.png"
alt="NYXIS Logo"
width="160"
height="160"
style="border-radius: 50%; object-fit: cover;">
</p>
<p align="center">
<img src="https://huggingface.co/QuantaSparkLabs/NYXIS-Pro/resolve/main/logoname.png"
alt="NYXIS Name"
width="700"
style="border-radius: 18px;">
</p>
<h1 align="center">Antiplex-Instruct-3B</h1>
<p align="center">
A warm, direct, openworld conversational AI built on <strong>Phi3mini</strong> — no corporate bot vibes, just honest chat.
</p>
<p align="center">
<a href="https://huggingface.co/microsoft/Phi-3-mini-4k-instruct"><img src="https://img.shields.io/badge/Base-Phi--3--mini--4k-blueviolet" alt="Base Model"></a>
<a href="https://huggingface.co/datasets/teknium/OpenHermes-2.5"><img src="https://img.shields.io/badge/Data-OpenHermes%202.5-00BFFF" alt="Training Data"></a>
<a href="#"><img src="https://img.shields.io/badge/Fine--Tune-QLoRA%20%2B%20Unsloth-FF6F00" alt="Fine-Tune Method"></a>
<a href="#"><img src="https://img.shields.io/badge/Anti--Tic-No%20%22How%20may%20I%22-brightgreen" alt="Anti-Tic Identity"></a>
<a href="#"><img src="https://img.shields.io/badge/Web%20Search-Tool--Ready-lightgrey" alt="Web Search"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-yellow" alt="License"></a>
</p>
<div style="background: #dc3545; color: #ffffff; padding: 15px 20px; border-radius: 8px; margin: 20px 0;">
### ⚠️ Important
This model has been **completely rebuilt** from the ground up. The previous version suffered from corrupted config files, fused-weight mismatches, and gibberish output. Those issues are now fully resolved.
**You can load the model directly with `AutoModelForCausalLM.from_pretrained`** — no special libraries, no hacks, no "as an AI" deflections.
Please review the model files (`config.json`, `model.safetensors`, and tokenizer files) before installation to ensure you are using the latest version.
MODEL work done.
</div>
---
## 📋 Overview
**Antiplex-Instruct-3B** is a high-performance instruction-tuned language model developed by **QuantaSparkLabs**. Released in 2026, this model is engineered for dual-task capability, delivering accurate identity alignment, reliable SQL generation, and strong general reasoning, while remaining lightweight and efficient.
The model is fine-tuned using **LoRA (PEFT)** on curated datasets emphasizing identity consistency and structured reasoning, making it ideal for edge deployment and specialized assistant roles.
## ✨ Core Features
| 🎯 Task Versatility | ⚡ Performance Optimized |
| :--- | :--- |
| **Text Generation**: SQL/NLP, creative writing, technical explanations. | **LoRA Fine-tuning**: Efficient parameter adaptation. |
| **Classification**: Intent detection, task routing, safety filtering. | **Identity Alignment**: Consistent persona across interactions. |
| **Dual-Mode**: Single model handling generation + classification. | **Lightweight**: ~3.8B parameters, edge-friendly VRAM footprint. |
<p align="center">
<img src="statics.png" width="900" alt="statics"/>
</p>
---
## 📊 Performance Benchmarks
### 🏆 Accuracy Metrics
| Task | Accuracy | Confidence |
| :--- | :--- | :--- |
| Identity Verification | 100% | ⭐⭐⭐⭐⭐ |
| SQL Generation | 100% | ⭐⭐⭐⭐⭐ |
| General Reasoning | 90% | ⭐⭐⭐⭐ |
### 🔬 Reliability Assessment
**21-Test Internal Validation Suite**
* **Passed:** 16 tests (76.2%)
* **Failed:** 5 tests (23.8%)
* **Overall Grade:** B (Good)
<p align="center">
<img src="overview.png" width="900" alt="overview"/>
</p>
<details>
<summary>📈 View Detailed Test Categories</summary>
| Category | Tests | Passed | Rate |
| :--- | :--- | :--- | :--- |
| Identity Tasks | 7 | 7 | 100% |
| SQL Generation | 6 | 6 | 100% |
| Reasoning | 5 | 3 | 60% |
| Classification | 3 | 2 | 66.7% |
**Test Dataset:** `QuantaSparkLabs/antiplex-test-suite`
</details>
---
## 🏗️ Model Architecture
### Training Pipeline
```mermaid
graph TD
A[Base Model Phi-3-mini] --> B[LoRA Fine-tuning]
B --> C[Task-Specific Heads]
C --> D[Text Generation Head]
C --> E[Classification Head]
D --> F[Generation Output]
E --> G[Classification Output]
H[Instruction Dataset] --> B
I[SQL Dataset] --> B
J[Identity Dataset] --> B
```
<p align="center">
<img src="structure.png" width="900" alt="structure"/>
</p>
### Inference Flow
```
User Prompt → Tokenization → Antiplex Core → Task Router
[Generation/Classification] → Post-processing → Output
```
---
## 🔧 Technical Specifications
| Parameter | Value |
| :--- | :--- |
| **Base Model** | `unsloth/Phi-3-mini-4k-instruct-bnb-4bit` |
| **Fine-tuning** | LoRA (PEFT) |
| **Rank (r)** | 16 |
| **Alpha (α)** | 32 |
| **Optimizer** | AdamW (β₁=0.9, β₂=0.999) |
| **Learning Rate** | 2e-4 |
| **Batch Size** | 8 |
| **Epochs** | 3 |
| **Total Parameters** | ~3.8B |
### Dataset Composition
| Dataset Type | Samples | Purpose |
| :--- | :--- | :--- |
| Identity Alignment | 30 | Consistent persona training |
| SQL Generation | 300 | Structured query training |
| Instruction Tuning | 2,500 | General capability enhancement |
| Classification | 1,000 | Intent detection training |
---
## 💻 Quick Start
### Installation
```bash
pip install transformers torch accelerate
```
### Basic Usage (Text Generation)
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "QuantaSparkLabs/Antiplex-instruct-3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
prompt = "Write an SQL query to fetch users created in the last 30 days."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### Classification Mode
```python
# Intent classification example
classification_prompt = """[CLASSIFY]
User Query: "I need to reset my account password"
Categories: account_issue, technical_support, billing, general_inquiry
"""
inputs = tokenizer(classification_prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=64,
temperature=0.3,
do_sample=False
)
detected_intent = tokenizer.decode(outputs[0], skip_special_tokens=True).split('[')[-1].split(']')[0]
print(f"Detected Intent: {detected_intent}")
```
### Chat Interface
```python
from transformers import pipeline
chatbot = pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
device=0 if torch.cuda.is_available() else -1
)
messages = [
{"role": "system", "content": "You are Antiplex, a helpful AI assistant specialized in SQL and classification tasks."},
{"role": "user", "content": "Classify this intent: 'Can you help me with invoice generation?' Then write a SQL query to find recent invoices."}
]
response = chatbot(messages, max_new_tokens=512, temperature=0.7)
print(response[0]['generated_text'][-1]['content'])
```
---
## 🚀 Deployment Options
### Hardware Requirements
| Environment | VRAM | Quantization | Speed |
| :--- | :--- | :--- | :--- |
| **GPU (Optimal)** | 8-12 GB | FP16 | ⚡ Fast |
| **GPU (Efficient)** | 4-6 GB | INT8 | ⚡ Fast |
| **CPU** | N/A | FP32 | 🐌 Slow |
| **Edge Device** | 2-4 GB | INT4 | ⚡ Fast |
### Cloud Deployment (Docker)
```dockerfile
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "app.py"]
```
---
## 📁 Repository Structure
```
Antiplex-Instruct-3B/
├── README.md
├── model.safetensors
├── config.json
├── tokenizer.json
├── tokenizer_config.json
├── generation_config.json
├── special_tokens_map.json
├── quantasparklogo.png
├── examples/
│ ├── classification_demo.py
│ ├── sql_generation_demo.py
│ └── chat_interface.py
└── evaluation/
└── test_results.json
```
---
## ⚠️ Limitations & Safety
### Known Limitations
- **Domain Specificity**: Not trained for medical/legal/safety-critical domains
- **Bias Inheritance**: May reflect biases in training data
- **Context Window**: Limited to 4K tokens
- **Multilingual**: Primarily English-focused
### Safety Guidelines
```python
# Recommended safety wrapper
def safety_check(text):
blocked_terms = ["harmful", "dangerous", "illegal", "exploit"]
if any(term in text.lower() for term in blocked_terms):
return "Content filtered for safety reasons."
return text
```
---
## 🔄 Version History
| Version | Date | Changes |
| :--- | :--- | :--- |
| v1.0.0 | 2026-01-1 | Initial release |
| v1.1.0 | 2026-01-10 | Enhanced classification head |
| v1.2.0 | 2026-01-25 | SQL generation improvements |
---
## 📄 License & Citation
**License:** Apache 2.0
**Citation:**
```bibtex
@misc{antiplex2026,
title={Antiplex-Instruct-3B: A Dual-Task Instruction-Tuned Language Model},
author={QuantaSparkLabs},
year={2026},
url={https://huggingface.co/QuantaSparkLabs/Antiplex-instruct-3B}
}
```
---
## 👥 Credits & Acknowledgments
- **Base Model**: Microsoft Phi-3 Mini team
- **Fine-tuning Framework**: Unsloth for efficient LoRA training
- **Evaluation**: Internal QuantaSparkLabs team
- **Testing**: Community contributors
---
## 🤝 Contributing & Support
### Reporting Issues
Please open an issue on our repository with:
1. Model version
2. Reproduction steps
3. Expected vs actual behavior
---
<p align="center">
<i>Built with ❤️ by QuantaSparkLabs</i><br/>
<sub>Model ID: Antiplex-Instruct-3B • Parameters: ~3.8B • Release: 2026</sub>
</p>
<p align="center">
<a href="https://github.com/unslothai/unsloth">
<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>
</a>
</p>
>Someone gimmi a cup of coffe!☕

8
chat_template.jinja Normal file
View File

@@ -0,0 +1,8 @@
{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|>
' + message['content'] + '<|end|>
'}}{% elif message['role'] == 'user' %}{{'<|user|>
' + message['content'] + '<|end|>
'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>
' + message['content'] + '<|end|>
'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>
' }}{% else %}{{ eos_token }}{% endif %}

31
config.json Normal file
View File

@@ -0,0 +1,31 @@
{
"architectures": [
"MistralForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 1,
"dtype": "float16",
"eos_token_id": 32000,
"head_dim": 96,
"hidden_act": "silu",
"hidden_size": 3072,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 4096,
"model_type": "mistral",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 32,
"pad_token_id": 32009,
"rms_norm_eps": 1e-05,
"rope_parameters": {
"rope_theta": 10000.0,
"rope_type": "default"
},
"sliding_window": 2048,
"tie_word_embeddings": false,
"transformers_version": "5.5.0",
"unsloth_version": "2026.5.5",
"use_cache": true,
"vocab_size": 32064
}

View File

@@ -0,0 +1,19 @@
{
"model_name": "QuantaSparkLabs/Antiplex-instruct-3B",
"performance": {
"identity_verification_accuracy": 1.0,
"sql_generation_accuracy": 1.0,
"general_reasoning_accuracy": 0.9,
"overall_grade": "B (Good)",
"test_dataset": "QuantaSparkLabs/antiplex-test-suite",
"total_tests": 21,
"passed_tests": 16
},
"training_details": {
"base_model": "unsloth/Phi-3-mini-4k-instruct-bnb-4bit",
"fine_tune_method": "LoRA (PEFT)",
"parameters": "3.8B",
"identity_examples": 30,
"sql_examples": 300
}
}

12
generation_config.json Normal file
View File

@@ -0,0 +1,12 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": [
32000,
32001,
32007
],
"max_length": 4096,
"pad_token_id": 32009,
"transformers_version": "5.5.0"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d139f1b6b6e1356ae8601fdcd15fd20015e96fde2c6332b79b0d0fab11e6ff0
size 7642192536

BIN
overview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
quanta.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
statics.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
structure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

277210
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

BIN
tokenizer.model (Stored with Git LFS) Normal file

Binary file not shown.

130
tokenizer_config.json Normal file
View File

@@ -0,0 +1,130 @@
{
"add_prefix_space": null,
"backend": "tokenizers",
"bos_token": "<s>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"is_local": false,
"legacy": false,
"model_max_length": 4096,
"pad_token": "<|placeholder6|>",
"padding_side": "left",
"sp_model_kwargs": {},
"tokenizer_class": "TokenizersBackend",
"unk_token": "<unk>",
"use_default_system_prompt": false,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"1": {
"content": "<s>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"2": {
"content": "</s>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": false
},
"32000": {
"content": "<|endoftext|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"32001": {
"content": "<|assistant|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32002": {
"content": "<|placeholder1|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32003": {
"content": "<|placeholder2|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32004": {
"content": "<|placeholder3|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32005": {
"content": "<|placeholder4|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32006": {
"content": "<|system|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32007": {
"content": "<|end|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32008": {
"content": "<|placeholder5|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
},
"32009": {
"content": "<|placeholder6|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"32010": {
"content": "<|user|>",
"single_word": false,
"lstrip": false,
"rstrip": true,
"normalized": false,
"special": true
}
}
}