Downloads · 30 days
0
ovinduG/phi-3.5-mini-mtl-router-validator
phi-3.5-mini-mtl-router-validator is a text generation model from ovinduG. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a Multi-Task Learning (MTL) model fine-tuned on Microsoft Phi-3.5-mini-instruct (3.8B parameters) using LoRA adapters. The model performs two distinct tasks:
Downloads · 30 days
0
Access
Public
Updated Jan 30, 2026
Repo size
23.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors23.1 MB · 86%
From the Hugging Face model README
This is a Multi-Task Learning (MTL) model fine-tuned on Microsoft Phi-3.5-mini-instruct (3.8B parameters) using LoRA adapters. The model performs two distinct tasks:
Domains: coding, data_analysis, technology, mathematics, api_generation, history, literature, creative_content, geography, law, medicine, business, education, science, sensitive, ambiguous, general_knowledge
pip install transformers peft torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load model
base_model = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3.5-mini-instruct",
trust_remote_code=True,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, "ovinduG/phi-3.5-mini-mtl-router-validator")
tokenizer = AutoTokenizer.from_pretrained("ovinduG/phi-3.5-mini-mtl-router-validator")
# Classify domain
messages = [
{
"role": "system",
"content": "You are a domain classification assistant. Classify the query and output JSON."
},
{
"role": "user",
"content": "Query: How do I implement a binary search in Python?"
}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=150)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
# Output: {"primary_domain": "coding", "secondary_domain": null, "is_multi_domain": false}
messages = [
{
"role": "system",
"content": "You are a hallucination detection assistant."
},
{
"role": "user",
"content": "Context: Paris is the capital of France.\n\nModel Output: Paris is the capital of France and has 10 million people.\n\nDoes this contain hallucinations?"
}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
# Output: Hallucination: Yes
# Explanation: The population figure is not mentioned in the context.
If you use this model, please cite:
@misc{phi35-mtl-ovinduG,
author = {ovinduG},
title = {Phi-3.5 Multi-Task Learning Model},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/ovinduG/phi-3.5-mini-mtl-router-validator}}
}
This model inherits the license from microsoft/Phi-3.5-mini-instruct.
Model trained using Multi-Task Learning (MTL) with hard parameter sharing and LoRA adapters.