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/inference_queue.py from end000/Qwen3.5-0.8B-WSPForge-Math-v1: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/inference_queue.py
- Command line
-
hf download hf://end000/Qwen3.5-0.8B-WSPForge-Math-v1/wspforge/research_code/src/inference_queue.py
-
curl -L -o inference_queue.py https://huggingface.co/end000/Qwen3.5-0.8B-WSPForge-Math-v1/resolve/main/wspforge/research_code/src/inference_queue.py
2.36 kB
| import json | |
| import time | |
| def completed_outputs(engine, prompts, samplings, stream=False): | |
| if not stream: | |
| for index, output in enumerate(engine.generate(prompts,samplings,use_tqdm=False)): | |
| yield index, output | |
| return | |
| identifiers = engine.enqueue(prompts,samplings,use_tqdm=False) | |
| processor = getattr(engine.llm_engine,'output_processor',None) | |
| if processor is not None: | |
| indices = {processor.request_states[request_id].external_req_id:index for index,request_id in enumerate(identifiers)} | |
| else: | |
| indices = {request_id:index for index,request_id in enumerate(identifiers)} | |
| finished = set() | |
| finished_tokens = 0 | |
| start = last = time.monotonic() | |
| while engine.llm_engine.has_unfinished_requests(): | |
| for output in engine.llm_engine.step(): | |
| if not output.finished: | |
| continue | |
| if output.request_id not in indices or output.request_id in finished: | |
| raise ValueError('Unknown or duplicate completed request') | |
| finished.add(output.request_id) | |
| finished_tokens += sum(len(completion.token_ids) for completion in getattr(output,'outputs',[])) | |
| yield indices[output.request_id],output | |
| now = time.monotonic() | |
| if now-last >= 30: | |
| progress = {'type':'queue_progress','completed':len(finished),'queued':len(indices), | |
| 'unfinished':engine.llm_engine.get_num_unfinished_requests(),'seconds':round(now-start,1), | |
| 'completed_response_tokens':finished_tokens} | |
| if processor is not None: | |
| states = [processor.request_states[request_id] for request_id in identifiers | |
| if request_id in processor.request_states] | |
| detokenizers = [getattr(state,'detokenizer',None) for state in states] | |
| if all(detokenizer is not None for detokenizer in detokenizers): | |
| progress['unfinished_response_tokens'] = sum(d.num_output_tokens() for d in detokenizers) | |
| progress['generated_response_tokens'] = finished_tokens + progress['unfinished_response_tokens'] | |
| print(json.dumps(progress),flush=True) | |
| last = now | |
| if len(finished) != len(indices): | |
| raise RuntimeError('Engine stopped with incomplete requests') | |