Qwen3 Moderate Behavioral Flexibility
Collection
moderately abliterated and improved context awareness and moderate behavioral flexibility variant of Qwen3. • 6 items • Updated • 1
How to use prithivMLmods/Qwen3-1.7B-ft-bf16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="prithivMLmods/Qwen3-1.7B-ft-bf16")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Qwen3-1.7B-ft-bf16")
model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Qwen3-1.7B-ft-bf16")
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]:]))How to use prithivMLmods/Qwen3-1.7B-ft-bf16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "prithivMLmods/Qwen3-1.7B-ft-bf16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "prithivMLmods/Qwen3-1.7B-ft-bf16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/prithivMLmods/Qwen3-1.7B-ft-bf16
How to use prithivMLmods/Qwen3-1.7B-ft-bf16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "prithivMLmods/Qwen3-1.7B-ft-bf16" \
--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": "prithivMLmods/Qwen3-1.7B-ft-bf16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "prithivMLmods/Qwen3-1.7B-ft-bf16" \
--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": "prithivMLmods/Qwen3-1.7B-ft-bf16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use prithivMLmods/Qwen3-1.7B-ft-bf16 with Docker Model Runner:
docker model run hf.co/prithivMLmods/Qwen3-1.7B-ft-bf16
Qwen3-1.7B-ft-bf16 is a fine-tuned, moderately abliterated variant of the Qwen3-1.7B model. Built upon the robust Qwen3 architecture, this version emphasizes improved context awareness and moderate behavioral flexibility, while maintaining high standards in reasoning, instruction-following, and multilingual performance. It is designed to perform consistently across general-purpose dialogue, technical reasoning, creative writing, and multilingual tasks.
pip install transformers==4.51.3
pip install huggingface_hub[hf_xet]
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Qwen3-1.7B-ft-bf16"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Define prompt and apply chat template
prompt = "Explain why the sky appears blue during the day and red at sunset."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True
)
# Tokenize input
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate response
generated_ids = model.generate(
**model_inputs,
max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
# Optional: Separate thinking content
try:
index = len(output_ids) - output_ids[::-1].index(151668) # token ID for </think>
except ValueError:
index = 0
thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print("thinking content:", thinking_content)
print("content:", content)
temperature=0.6, top_p=0.95, top_k=20, min_p=0.0temperature=0.7, top_p=0.8, top_k=20, min_p=0.03276838912"Please reason step by step, and put your final answer within \boxed{}."{"answer": "C"}Base model
Qwen/Qwen3-1.7B-Base