Instructions to use Allen-UQ/CNY-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Allen-UQ/CNY-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Allen-UQ/CNY-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Allen-UQ/CNY-7B") model = AutoModelForCausalLM.from_pretrained("Allen-UQ/CNY-7B", device_map="auto") 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 Settings
- vLLM
How to use Allen-UQ/CNY-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Allen-UQ/CNY-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": "Allen-UQ/CNY-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Allen-UQ/CNY-7B
- SGLang
How to use Allen-UQ/CNY-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 "Allen-UQ/CNY-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": "Allen-UQ/CNY-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 "Allen-UQ/CNY-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": "Allen-UQ/CNY-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Allen-UQ/CNY-7B with Docker Model Runner:
docker model run hf.co/Allen-UQ/CNY-7B
CNY-7B
Smaller reference checkpoint for CNY (Call Neighbours Yourself), a reinforcement learning framework that treats neighbour acquisition on a text-attributed graph as explicit graph-walk actions and supervises those actions with destination-conditioned on-policy self-distillation (OPSD).
Paper: Call Neighbours Yourself: Graph Walks with Destination-Conditioned On-Policy
Self-Distillation (EMNLP 2026), arXiv:2608.29588. The 14B counterpart is
Allen-UQ/CNY-14B.
What this checkpoint is
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Training | GRPO with the OPSD credit term, beta = 0.03, entropy coefficient 0 |
| Training mixture | Eight text-attributed graphs (seven node classification, WN18RR relation classification) |
| Selected step | 280 |
| Precision | bfloat16 |
This checkpoint is also the OPSD-on arm of the ablation in the paper, trained against
an otherwise identical beta = 0 control that uses the same reward and rollouts.
Zero-shot held-out accuracy
| Cora 7-way | Cora 2-way | WikiCS 10-way | WikiCS 5-way | Products 10-way | Products 5-way | FB15K237 10-way | Expla-Graph |
|---|---|---|---|---|---|---|---|
| 75.37 | 89.63 | 74.32 | 81.20 | 86.00 | 90.30 | 76.41 | 88.45 |
Evaluated on the full test split of each dataset.
How the model is meant to be used
This is not a plain chat model. It expects the CNY multi-step walk prompt, in which
the model observes the target node text, the label descriptions and a short preview
per neighbour, then emits <walk> actions to reveal a neighbour's full text before
committing to an answer. Prompting it as a standard instruct model will not exercise
the learned walk policy.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Allen-UQ/CNY-7B"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
For the walk environment, the prompt templates and the evaluation harness, use the code release (see the repository linked from the paper).
Limitations
CNY trains walk selection rather than a general graph reasoner. The walk policy is learned under a bounded step budget and a fixed preview format, and accuracy depends on the ego-node text being informative enough to direct the first walk.
Citation
@inproceedings{liu2026cny,
title = {Call Neighbours Yourself: Graph Walks with Destination-Conditioned On-Policy Self-Distillation},
author = {Yilun Liu and Boyu Luo and Yanran Tang and Ruihong Qiu and Zi Huang},
booktitle = {EMNLP},
year = {2026}
}
- Downloads last month
- 63