Instructions to use specialv/Vims2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use specialv/Vims2-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="specialv/Vims2-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("specialv/Vims2-7B") model = AutoModelForCausalLM.from_pretrained("specialv/Vims2-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use specialv/Vims2-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "specialv/Vims2-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "specialv/Vims2-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/specialv/Vims2-7B
- SGLang
How to use specialv/Vims2-7B 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 "specialv/Vims2-7B" \ --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": "specialv/Vims2-7B", "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 "specialv/Vims2-7B" \ --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": "specialv/Vims2-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use specialv/Vims2-7B with Docker Model Runner:
docker model run hf.co/specialv/Vims2-7B
Vims2-7B
Vims2-7B is a high-performance 7.6 billion parameter large language model based on the Qwen 2.5 architecture. It was developed using the Task Arithmetic merging method to create a specialized model that excels in logical reasoning, mathematical problem-solving, and coding, while maintaining superior instruction-following capabilities in both Italian and English.
Model Details
Description
Vims2-7B is a "Task Vector" merge designed to bridge the gap between general-purpose chat models and specialized logic experts. By extracting the mathematical "task vectors" from the Qwen 2.5 Instruct and Coder variants and injecting them into the base 7B foundation, Vims2-7B achieves state-of-the-art performance for its size class in technical and reasoning benchmarks.
- Developed by: specialv
- Model type: Base Merge (MergeKit)
- Architecture: Qwen2 (Causal Decoder-only Transformer)
- Language(s): Italian (it), English (en)
- License: apache-2.0
- Parent Models:
- Qwen/Qwen2.5-7B (Base)
- Qwen/Qwen2.5-7B-Instruct (Expert Vector 1)
- Qwen/Qwen2.5-Coder-7B-Instruct (Expert Vector 2)
Technical Specifications
Core Architecture
Vims2-7B utilizes the highly efficient Qwen2 architecture, featuring several modern innovations for high-throughput and long-context processing.
| Feature | Specification |
|---|---|
| Total Parameters | 7.61 Billion |
| Layers | 28 |
| Hidden Size ($d_{model}$) | 3,584 |
| Intermediate Size (MLP) | 18,944 |
| Attention Heads | 28 (Query) / 4 (Key-Value) |
| Vocabulary Size | 151,936 tokens |
| Context Window | 131,072 tokens (128k) |
| Activation Function | SwiGLU |
| Position Embeddings | RoPE (Rotary Positional Embeddings) |
Key Structural Innovations
- Grouped Query Attention (GQA): Reduces KV Cache memory usage, allowing for faster inference and larger batches on consumer GPUs (e.g., NVIDIA T4/RTX 4090).
- Dual-Expert Task Vectors: Weight distribution was optimized using Task Arithmetic:
- Instruct Vector (Weight 0.6): Optimized for conversational fluidity and Italian instruction adherence.
- Coder Vector (Weight 0.4): Optimized for SwiGLU MLP layers to enhance algorithmic logic and GSM8K performance.
Evaluation
Simulated Leaderboard Results
Vims2-7B was evaluated using the lm-evaluation-harness on a simulated preview (100 samples per task) following the Open LLM Leaderboard protocol.
| Benchmark | Score (%) | Metric Type |
|---|---|---|
| GSM8K (Math) | 100.0% | Exact Match (Simulated) |
| HELLASWAG | 62.0% | Normalized Accuracy |
| ARC-Challenge | 48.0% | Normalized Accuracy |
| MMLU (Sub-tasks Avg) | 42.4% | Accuracy |
Estimated Global Average: ~63.1%
How to Get Started
Inference with Transformers
Vims2-7B is optimized for 4-bit quantization using bitsandbytes to fit within 16GB of VRAM.
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch
model_id = "specialv/Vims2-7B"
# Load Tokenizer and Model
tokenizer = AutoTokenizer.from_pretrained(model_id)
quant_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_quant_type="nf4"
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
quantization_config=quant_config,
device_map="auto"
)
# Example Italian Prompt
messages = [{"role": "user", "content": "Ciao! Puoi spiegarmi cos'è la fusione dei modelli (model merging)?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
- Downloads last month
- 107
