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/code_worker.py from end000/Qwen3.5-0.8B-WSPForge-Math-v1: direct link, hf CLI and curl.
- Browser
- Download file 3.1 kB
-
https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/code_worker.py
- Command line
-
hf download hf://end000/Qwen3.5-0.8B-WSPForge-Math-v1/wspforge/research_code/src/code_worker.py
-
curl -L -o code_worker.py https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/code_worker.py
3.1 kB
| import ast | |
| import builtins | |
| import json | |
| import resource | |
| import random | |
| import sys | |
| from pathlib import Path | |
| ALLOWED_IMPORTS = {'math','cmath','re','string','collections','itertools','functools','heapq','bisect','typing', | |
| 'statistics','decimal','fractions','operator','random','copy','datetime','calendar','hashlib', | |
| 'json','base64','unicodedata','dataclasses','enum','array'} | |
| BLOCKED_CALLS = {'open','exec','eval','compile','globals','locals','vars','getattr','setattr','delattr', | |
| '__import__','breakpoint','help','input','exit','quit'} | |
| def validate(source): | |
| tree = ast.parse(source) | |
| for node in ast.walk(tree): | |
| if isinstance(node,(ast.Import,ast.ImportFrom)): | |
| modules = [alias.name.split('.')[0] for alias in node.names] if isinstance(node,ast.Import) else [(node.module or '').split('.')[0]] | |
| if isinstance(node,ast.ImportFrom) and node.level: | |
| raise ValueError('unsupported_relative_import') | |
| if any(module not in ALLOWED_IMPORTS for module in modules): | |
| raise ValueError('unsupported_import:'+','.join(modules)) | |
| if isinstance(node,ast.Name) and node.id.startswith('__') and node.id != '__name__': | |
| raise ValueError('unsupported_introspection') | |
| if isinstance(node,ast.Attribute) and (node.attr.startswith('_') or isinstance(node.ctx,ast.Store)): | |
| raise ValueError('unsupported_attribute_access') | |
| if isinstance(node,ast.Call): | |
| if isinstance(node.func,ast.Name) and node.func.id in BLOCKED_CALLS: | |
| raise ValueError('unsupported_call:'+node.func.id) | |
| if isinstance(node.func,ast.Attribute) and node.func.attr in {'attrgetter','methodcaller'}: | |
| raise ValueError('unsupported_introspection') | |
| return tree | |
| def main(): | |
| resource.setrlimit(resource.RLIMIT_CPU,(2,2)) | |
| resource.setrlimit(resource.RLIMIT_AS,(384*1024**2,384*1024**2)) | |
| resource.setrlimit(resource.RLIMIT_FSIZE,(65536,65536)) | |
| resource.setrlimit(resource.RLIMIT_NOFILE,(64,64)) | |
| resource.setrlimit(resource.RLIMIT_CORE,(0,0)) | |
| payload = json.loads(Path('/work/payload.json').read_text()) | |
| nonce = sys.argv[1] | |
| random.seed(0) | |
| result = {'passed':False} | |
| try: | |
| source = payload['code'] | |
| tree = validate(source) | |
| namespace = {'__builtins__':dict(vars(builtins)),'__name__':'candidate'} | |
| exec(compile(tree,'<candidate>','exec'),namespace) | |
| candidate = namespace.get(payload['entry_point']) | |
| if not callable(candidate): | |
| raise ValueError('missing_entry_point') | |
| test_namespace = {'__builtins__':dict(vars(builtins)),'__name__':'tests'} | |
| exec(compile(payload['test_code'],'<tests>','exec'),test_namespace) | |
| test_namespace['check'](candidate) | |
| result = {'passed':True} | |
| except BaseException as error: | |
| result = {'passed':False,'error_type':type(error).__name__,'error':str(error)[:300]} | |
| print('__WSP_RESULT__'+nonce+json.dumps(result),flush=True) | |
| if __name__ == '__main__': | |
| main() | |