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
Download wspforge/research_code/src/kernel.py from end000/Qwen3.5-0.8B-WSPForge-Math-v1: direct link, hf CLI and curl.
- Browser
- Download file 1.59 kB
-
https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/kernel.py
- Command line
-
hf download hf://end000/Qwen3.5-0.8B-WSPForge-Math-v1/wspforge/research_code/src/kernel.py
-
curl -L -o kernel.py https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/kernel.py
1.59 kB
| import json | |
| from pathlib import Path | |
| import torch | |
| from transformers import AutoTokenizer | |
| from safetensors import safe_open | |
| from common import ROOT, permit_compute, append | |
| from weights import headers, load as read_weight, save_edit as write_edit | |
| permit_compute() | |
| torch.set_grad_enabled(False) | |
| MODEL = ROOT / 'models/original' | |
| CURRENT = ROOT / 'edits/current' | |
| NAMES = sorted(headers(MODEL)) | |
| tok = AutoTokenizer.from_pretrained(MODEL, local_files_only=True) | |
| def load_original(name): | |
| return read_weight(MODEL, name).float() | |
| def load(name): | |
| if name not in NAMES: | |
| raise KeyError(name) | |
| path = CURRENT / (name + '.safetensors') | |
| if path.exists(): | |
| with safe_open(str(path), framework='pt', device='cpu') as f: | |
| return f.get_tensor(name).float() | |
| return load_original(name) | |
| def save_edit(name, tensor, hypothesis): | |
| return write_edit(MODEL, CURRENT, name, tensor, hypothesis) | |
| def edited(): | |
| return sorted(p.name.removesuffix('.safetensors') for p in CURRENT.glob('*.safetensors')) | |
| def drop_edit(name): | |
| permit_compute() | |
| if name not in NAMES: | |
| raise KeyError(name) | |
| for suffix in ('.safetensors', '.json', '.analysis.json', '.direction.npy'): | |
| path = CURRENT / (name + suffix) | |
| if path.exists(): | |
| path.unlink() | |
| append(ROOT / 'logs/experiments.jsonl', {'action': 'drop_edit', 'tensor': name}) | |
| print('CPU kernel готов: NAMES, load, load_original, save_edit(name,tensor,hypothesis), drop_edit, edited, tok. Градиенты отключены. Модель не запущена.') | |