File size: 2,701 Bytes
c2347bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
tags:
- phi-2
- conversational-ai
- fine-tuned
license: mit
datasets:
- UltraChat
- Clocal_data
base_model: microsoft/phi-2
---

# phi-2-chat

**A fine-tuned conversational variant of Microsoft's Phi-2 (2.7B) optimized for dialogue tasks**

[![Model License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![Hugging Face Hub](https://img.shields.io/badge/%F0%9F%A4%97%20Model%20Hub-Open-blue)](https://huggingface.co/Irfanuruchi/phi-2-chat)

## Model Details

### **Base Model**
[microsoft/phi-2](https://huggingface.co/microsoft/phi-2) (2.7B parameters, MIT License)

### **Training Data**
1. **[UltraChat](https://github.com/thunlp/UltraChat)** (CC-BY-NC-4.0):
```bibtex
   @misc{ultrachat,
     title={UltraChat: A Large-Scale Auto-generated Multi-round Dialogue Dataset},
     author={Ding et al.},
     year={2023},
     howpublished={\url{https://github.com/thunlp/UltraChat}}
   }
```
2. Custom synthetic data(Proprietary)


### **Fine-Tuning**
- **Objective**: Instruction-following & conversational ability
- **Framework**: PyTorch + Transformers
- **Context Window**: 2048 tokens


## Usage

### Quick Inference

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "Irfanuruchi/phi-2-chat",
    trust_remote_code=True,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Irfanuruchi/phi-2-chat")

# Recommended prompt format:
input_text = "<|user|>Explain dark matter<|assistant|>"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

```


## Limitations

- ** Licence Restrictions: License Restrictions: Non-commercial use applies to UltraChat-derived components (CC-BY-NC-4.0)
- ** Bias: May reflect biases in base model and training data



## License

- **Core Model**: MIT (inherited from Phi-2)
- **UltraChat Components**: CC-BY-NC-4.0 (non-commercial clause applies)
- **Custom Data**: Proprietary

  

## Citation

```bibtex
@misc{phi-2-chat,
  author = {Irfan Uruchi},
  title = {phi-2-chat: Fine-tuned Phi-2 for conversational AI},
  year = {2025},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/Irfanuruchi/phi-2-chat}}
}

@misc{phi2,
  title={Phi-2: The Surprisingly Capable Small Language Model}, 
  author={Microsoft},
  year={2023},
  url={https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/}
}
```


## Contact

For questions or issues, please open a discussion on the Hugging Face Hub.

Or you can do the same also in GitHub:

https://github.com/IrfanUruchi/phi-2-chat