Text Generation
Transformers
Safetensors
qwen2
interpretability
natural-language-autoencoder
activation-verbalizer
qwen2.5
conversational
text-generation-inference
Instructions to use andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av") model = AutoModelForCausalLM.from_pretrained("andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av", 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 andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av
- SGLang
How to use andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av 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 "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av" \ --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": "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av", "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 "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av" \ --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": "andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av with Docker Model Runner:
docker model run hf.co/andyx10/Qwen2.5-1.5B-Instruct-NLA-L18-av
Andy Xu
Restructured re-upload of dormantx/Qwen2.5-1.5B-NLA-L18: merged weights + root nla_meta.yaml, matching the kitft/Llama-3.3-70B-NLA-L53 layout
1dd66d1 verified | kind: nla_model | |
| schema_version: 2 | |
| d_model: 1536 | |
| tokens: | |
| injection_char: <|image_pad|> | |
| injection_token_id: 151655 | |
| injection_left_neighbor_id: 220 | |
| injection_right_neighbor_id: 151645 | |
| critic_suffix_ids: null | |
| prompt_templates: | |
| av: '<|im_start|>system | |
| You interpret neural-network activations. Given one activation vector, name in a single sentence the | |
| concept, entity, topic, or syntactic role it encodes. Be concrete; do not hedge or add preamble.<|im_end|> | |
| <|im_start|>user | |
| Activation: {injection_char}<|im_end|> | |
| <|im_start|>assistant | |
| ' | |
| ar: '{explanation}' | |
| created_by: nla (dormantx/NLA_Qwen2.5_1.5B pipeline) | |
| role_aliases: | |
| verbalizer: actor | |
| recon: critic | |
| layer: 18 | |
| extraction_layer_index: 18 | |
| base_model: Qwen/Qwen2.5-1.5B-Instruct | |
| role: av | |
| stage: sl | |
| extraction: | |
| injection_scale: 1.01256 | |
| mse_scale: 1.0 | |
| training: | |
| lr: 1.0e-05 | |
| loss_type: sft_next_token | |
| global_batch_size: 16 | |
| num_layers: 28 | |