Downloads · 30 days
16
14% of all-time downloads
adarsh-08/qwen-hr-assistant
qwen-hr-assistant is a question answering model from adarsh-08. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Qwen2.5-0.5B-Instruct, adapted to act as an HR assistant chatbot for a fictional company, NovaTech Solutions. It answers employee questions about HR policies including leave (casu…
Downloads · 30 days
16
14% of all-time downloads
All-time downloads
114
Public
Parameters
494M
999 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors988 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of Qwen2.5-0.5B-Instruct, adapted to act as an HR assistant chatbot for a fictional company, NovaTech Solutions. It answers employee questions about HR policies including leave (casual, sick, earned, unpaid, maternity, paternity), health/dental/vision insurance, wellness programs, performance reviews, travel & expense policies, IT/device usage, and onboarding.
The model was fine-tuned using QLoRA (4-bit quantized base model + LoRA adapters) on a custom instruction-response dataset, then the LoRA adapter was merged into the base model weights for standalone deployment.
This model is intended for answering employee HR-policy questions in a Q&A/chatbot format, specifically for a single fictional company's internal policies (NovaTech Solutions). It is best used as a demo or internal FAQ assistant, not as a source of legally binding HR guidance.
Use this model for demonstration, prototyping, or as a starting point for a real internal HR assistant — not as an authoritative source. Any deployment handling real employee questions should include human review, a way to escalate to real HR staff, and further evaluation of factual accuracy before production use.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "your-username/qwen-hr-assistant"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
prompt = "Question: How many days of paid leave am I entitled to per year?\n\nAnswer:"
inputs = tokenizer(prompt, return_tensors="pt")
output_ids = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
answer = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(answer)
A custom synthetic dataset of ~512 instruction-response pairs covering NovaTech Solutions' HR policies: leave types, insurance/benefits, wellness programs, performance reviews, travel & expenses, IT device policy, and onboarding. Multiple paraphrased questions map to the same canonical answer per topic, to encourage robustness to phrasing variation. Data was split 90/10 into train/validation sets.
Fine-tuned using QLoRA: the base model was loaded in 4-bit (NF4) precision via bitsandbytes, and LoRA adapters were trained on top using the peft library. After training, the adapter was merged into the base model weights (merge_and_unload) for standalone deployment.
Each example was formatted as:
Question: {instruction}
Answer: {response}
with an explicit EOS token appended, and a dedicated pad token (distinct from EOS) added to the tokenizer to avoid masking real end-of-sequence tokens during training.
10% held-out split from the same synthetic dataset (random seed 42).
Validation loss (cross-entropy) was used as the primary metric, with the best checkpoint (lowest validation loss) selected automatically at the end of training.
Qualitative spot-checks after training showed accurate, on-topic, well-formatted answers for most HR policy questions. One coverage gap was identified (aggregate "total paid leave" questions defaulted to sick-leave-only answers) and fixed by adding targeted training examples in a follow-up training run.
The model performs well on in-distribution HR questions closely matching training phrasing and topics, with occasional numeric hallucination risk typical of small models trained on limited data. Recommended as a demo/prototype assistant rather than a production HR system without further validation.
Decoder-only causal language model (Qwen2.5 architecture), fine-tuned via low-rank adaptation (LoRA) for the causal language modeling objective, then merged into the base weights.
Google Colab (GPU runtime)
transformerspeftbitsandbytesacceleratetorchdatasets