Views
No views yet

A lightweight, instruction-tuned version of Microsoft's Phi-2, customized for use cases and conversations related to The NorthCap University (NCU), India. Fine-tuned using LoRA on 1,098 high-quality examples, it's optimized for academic, administrative, and smart campus queries.
microsoft/phi-2 (2.7B parameters).safetensors) + tokenizer| Platform | Access Method |
|---|---|
| Hugging Face | phi2-ncu-model |
| Hugging Face Space | Live Chatbot Demo |
| Ollama (Offline) | ollama create phi2-ncu -f Modelfile (self-hosted only) |
👉 Visit: https://huggingface.co/spaces/pranav2711/phi2-ncu-chat-spaceGradio, deployed on Hugging Face Spacespip install transformers accelerate peft1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel, PeftConfig
3
4# Load adapter config
5adapter_path = "pranav2711/phi2-ncu-model"
6base_model = "microsoft/phi-2"
7
8# Load tokenizer and base
9tokenizer = AutoTokenizer.from_pretrained(base_model)
10model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
11
12# Load fine-tuned adapter
13model = PeftModel.from_pretrained(model, adapter_path)
14
15# Inference
16input_prompt = "### Question:\nHow can I apply for re-evaluation at NCU?\n\n### Answer:"
17inputs = tokenizer(input_prompt, return_tensors="pt").to("cuda")
18outputs = model.generate(**inputs, max_new_tokens=200)
19print(tokenizer.decode(outputs[0], skip_special_tokens=True))This works only locally viaollama createand not yet shareable as public Ollama model hub is restricted.
phi2-ncu/
├── Modelfile
└── model/
├── model.safetensors
├── config.json
├── tokenizer.json
├── tokenizer_config.json
├── vocab.json
├── merges.txt1ollama create phi2-ncu -f Modelfile
2ollama run phi2-ncu1{
2 "instruction": "How do I get my degree certificate?",
3 "input": "I'm a 2023 BTech passout from CSE at NCU.",
4 "output": "You can collect your degree certificate from the admin block on working days between 9AM and 4PM. Carry a valid ID proof."
5}### Question:
How do I get my degree certificate?
I'm a 2023 BTech passout from CSE at NCU.
### Answer:
You can collect your degree certificate...LoRA with rank=8, alpha=16Trainer with fp16=False to avoid CUDA AMP issues