Text Generation
Transformers
Safetensors
English
Russian
qwen3_5
image-text-to-text
weight-space-programming
wspforge
math
experimental
conversational
Instructions to use end000/Qwen3.5-0.8B-WSPForge-Math-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use end000/Qwen3.5-0.8B-WSPForge-Math-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="end000/Qwen3.5-0.8B-WSPForge-Math-v1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("end000/Qwen3.5-0.8B-WSPForge-Math-v1") model = AutoModelForMultimodalLM.from_pretrained("end000/Qwen3.5-0.8B-WSPForge-Math-v1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use end000/Qwen3.5-0.8B-WSPForge-Math-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "end000/Qwen3.5-0.8B-WSPForge-Math-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "end000/Qwen3.5-0.8B-WSPForge-Math-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1
- SGLang
How to use end000/Qwen3.5-0.8B-WSPForge-Math-v1 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 "end000/Qwen3.5-0.8B-WSPForge-Math-v1" \ --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": "end000/Qwen3.5-0.8B-WSPForge-Math-v1", "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 "end000/Qwen3.5-0.8B-WSPForge-Math-v1" \ --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": "end000/Qwen3.5-0.8B-WSPForge-Math-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use end000/Qwen3.5-0.8B-WSPForge-Math-v1 with Docker Model Runner:
docker model run hf.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1
File size: 2,558 Bytes
fc32096 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | import re
from collections import Counter
def extract(text):
text = text.split('</think>')[-1].strip()
index = text.rfind('\\boxed')
if index < 0:
index = text.rfind('\\fbox')
if index < 0:
return None
key = '\\boxed' if text.startswith('\\boxed', index) else '\\fbox'
rest = text[index + len(key):]
stripped = rest.lstrip()
if stripped.startswith('{'):
depth = 0
for i, char in enumerate(stripped):
depth += (char == '{') - (char == '}')
if depth == 0:
return stripped[1:i].strip() or None
elif key == '\\boxed' and rest.startswith(' '):
return rest.strip().split('$')[0].split('\n')[0].strip() or None
return None
def correct(prediction, gold):
if prediction is None:
return False
from math_verify import parse, verify
reference = parse('\\boxed{' + gold + '}', parsing_timeout=5)
candidate = parse('\\boxed{' + prediction + '}', parsing_timeout=5)
return bool(reference and candidate and verify(reference, candidate, timeout_seconds=5))
def repetition(text):
words = text.split()[-1000:]
grams = [tuple(words[i:i + 8]) for i in range(max(0, len(words) - 7))]
duplicate = 1 - len(set(grams)) / max(1, len(grams))
tail = words[-200:]
four = [tuple(tail[i:i + 4]) for i in range(max(0, len(tail) - 3))]
counts = Counter(four)
repetitive = bool(four) and sum(counts[g] >= 3 for g in four) / len(four) >= .5
return {'duplicate_8gram_tail': duplicate, 'repetitive_end': repetitive,
'whitespace_tail': bool(text) and not text[-1000:].strip(),
'thinking_closed': '</think>' in text}
def grade_ifeval(row, text):
import nltk
from common import ROOT
from langdetect import DetectorFactory
from instruction_following_eval import instructions_registry as registry
nltk.data.path[:] = [str(ROOT / 'data/nltk')]
DetectorFactory.seed = 0
response = text.split('</think>')[-1].strip() if '</think>' in text else ''
flags = []
for instruction_id, kwargs in zip(row['instruction_id_list'], row['kwargs']):
checker = registry.INSTRUCTION_DICT[instruction_id](instruction_id)
checker.build_description(**{k: v for k, v in (kwargs or {}).items() if v is not None})
args = checker.get_instruction_args()
if args and 'prompt' in args:
checker.build_description(prompt=row['prompt'])
flags.append(bool(response) and bool(checker.check_following(response)))
return all(flags)
|