This model is a fine-tuned version of
Qwen/Qwen3-1.7B-Base trained on the
HuggingFaceH4/ultrachat_200k dataset using Supervised Fine-Tuning (SFT) with LoRA adapters.
This model was trained on the
HuggingFaceH4/ultrachat_200k dataset:
The UltraChat dataset contains high-quality multi-turn conversations designed to improve instruction-following capabilities.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat"
5
6# Load tokenizer and model
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 torch_dtype=torch.bfloat16,
11 device_map="auto"
12)
13
14# Chat format
15messages = [
16 {"role": "system", "content": "You are a helpful assistant."},
17 {"role": "user", "content": "What are the key principles of effective communication?"}
18]
19
20# Apply chat template
21text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
22inputs = tokenizer(text, return_tensors="pt").to(model.device)
23
24# Generate
25outputs = model.generate(
26 **inputs,
27 max_new_tokens=512,
28 temperature=0.7,
29 top_p=0.9,
30 do_sample=True
31)
32
33response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
34print(response)
1from transformers import pipeline
2
3generator = pipeline(
4 "text-generation",
5 model="ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat",
6 device_map="auto",
7 torch_dtype="auto"
8)
9
10messages = [{"role": "user", "content": "Explain quantum computing in simple terms."}]
11output = generator(messages, max_new_tokens=256, return_full_text=False)
12print(output[0]["generated_text"])
For CPU or mixed CPU/GPU inference, GGUF quantized versions are available at:
ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat-GGUF
1ollama pull hf.co/ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat-GGUF:Q4_K_M
2ollama run hf.co/ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat-GGUF:Q4_K_M "Hello, how are you?"
1@misc{ermiaazarkhalili_qwen3_1.7b_sft_ultrachat,
2 author = {Ermia Azarkhalili},
3 title = {Qwen3-1.7B-SFT-UltraChat: Fine-tuned Qwen3-1.7B-Base on UltraChat},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/ermiaazarkhalili/Qwen3-1.7B-SFT-UltraChat}}
7}
For questions, issues, or collaborations, please open an issue on the model repository or contact via
HuggingFace.