Instructions to use bishmoy/Qwen3-1.7B-ReLU with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bishmoy/Qwen3-1.7B-ReLU with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bishmoy/Qwen3-1.7B-ReLU") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bishmoy/Qwen3-1.7B-ReLU") model = AutoModelForCausalLM.from_pretrained("bishmoy/Qwen3-1.7B-ReLU") 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 bishmoy/Qwen3-1.7B-ReLU with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bishmoy/Qwen3-1.7B-ReLU" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bishmoy/Qwen3-1.7B-ReLU", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bishmoy/Qwen3-1.7B-ReLU
- SGLang
How to use bishmoy/Qwen3-1.7B-ReLU 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 "bishmoy/Qwen3-1.7B-ReLU" \ --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": "bishmoy/Qwen3-1.7B-ReLU", "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 "bishmoy/Qwen3-1.7B-ReLU" \ --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": "bishmoy/Qwen3-1.7B-ReLU", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bishmoy/Qwen3-1.7B-ReLU with Docker Model Runner:
docker model run hf.co/bishmoy/Qwen3-1.7B-ReLU
Qwen3-1.7B-ReLU
This repository contains a ReLU-fied variant of Qwen3 1.7B released as part of the ReLU-Tune project.
The model was created by replacing the transformer MLP activation with ReLU across all decoder layers and then recovering performance through staged LoRA fine-tuning. The weights in this repository are provided as a merged checkpoint for straightforward loading and evaluation.
What This Model Is
- Base model:
Qwen/Qwen3-1.7B - Architecture change: transformer MLP activations changed to ReLU
- Modified layers: all decoder MLP activation sites
- Training method: staged LoRA fine-tuning
- Training schedule: 2 stages, 900 steps each, 1800 total steps
- Training data: continued pretraining on
tiiuae/falcon-refinedweb - Model format: merged dense model
- Extra metadata:
activation_config.jsondocuments the activation modification
Intended Use
This model is intended for:
- research on activation functions in large language models
- experiments on sparse activations and efficiency tradeoffs
- evaluation and fine-tuning workflows built on top of ReLU-Tune
This is primarily a research release, not a production-optimized instruction model.
Files
Typical files in this repository include:
model.safetensorsconfig.jsongeneration_config.jsontokenizer.jsontokenizer_config.jsonchat_template.jinjaactivation_config.json
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "bishmoy/Qwen3-1.7B-ReLU"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
Notes
activation_config.jsonis included for reproducibility and to document how activations were modified.- This release should follow the base Qwen model's license and usage terms. Users should review and comply with the original model terms before use or redistribution.
- Because this is a merged checkpoint, no adapter loading is required for standard inference.
Project
This model was produced with ReLU-Tune, a toolkit for:
- full or partial ReLU-fication
- staged LoRA fine-tuning
- benchmark and perplexity evaluation
- activation sparsity measurement
Limitations
This is an experimental model release. ReLU-fication changes the base architecture and can alter behavior in ways that differ from the original dense model. Downstream performance, calibration, and robustness should be validated for any intended use.
- Downloads last month
- -