Text Generation
PEFT
Safetensors
English
mistral
unsloth
lora
phi-3
customer-support
fine-tuned
qlora
conversational
Instructions to use 00harshh/phi3-mini-support-bot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 00harshh/phi3-mini-support-bot with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
| 1 |
-
Phi-3-mini-4k-instruct — Customer Support Fine-tune
|
| 2 |
-
|
| 3 |
-
A LoRA fine-tune of Microsoft's Phi-3-mini-4k-instruct (3.8B), trained on 467 cleaned customer support Q&A pairs spanning shipping, returns, payments, orders, sizing, and account inquiries for a retail/e-commerce context. Fine-tuned using Unsloth with 4-bit QLoRA (rank 16, alpha 16) over 3 epochs on a single T4 GPU.
|
| 4 |
-
|
| 5 |
-
The model is tuned to respond in the tone and phrasing style of the training set's support answers (policy language, portal references, timeframes) rather than generic conversational filler. Best suited for retail customer-support-style Q&A within the categories it was trained on; not intended for general-purpose or safety-critical use, and may hallucinate specifics (order numbers, exact policy details) on out-of-distribution questions — outputs should be reviewed before being shown to real customers.
|
| 6 |
-
|
| 7 |
---
|
| 8 |
license: mit
|
| 9 |
base_model: unsloth/Phi-3-mini-4k-instruct
|
|
@@ -21,7 +15,75 @@ library_name: peft
|
|
| 21 |
model_type: phi3
|
| 22 |
datasets:
|
| 23 |
- custom
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
base_model: unsloth/Phi-3-mini-4k-instruct
|
|
|
|
| 15 |
model_type: phi3
|
| 16 |
datasets:
|
| 17 |
- custom
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Phi-3-mini-4k-instruct — Customer Support Fine-tune
|
| 21 |
+
|
| 22 |
+
A LoRA fine-tune of Microsoft's [Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) (3.8B parameters), adapted for retail/e-commerce customer support conversations. Trained using [Unsloth](https://unsloth.ai) with 4-bit QLoRA for fast, memory-efficient fine-tuning on a single T4 GPU.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
- **Base model:** unsloth/Phi-3-mini-4k-instruct
|
| 27 |
+
- **Fine-tuning method:** QLoRA (4-bit), rank 16, alpha 16
|
| 28 |
+
- **Framework:** Unsloth + TRL `SFTTrainer`
|
| 29 |
+
- **Training hardware:** 1x NVIDIA T4 (Google Colab, free tier)
|
| 30 |
+
- **Training data:** 467 cleaned, deduplicated customer support Q&A pairs (custom dataset)
|
| 31 |
+
|
| 32 |
+
## Training Data
|
| 33 |
+
|
| 34 |
+
The training set covers common retail support scenarios across these categories:
|
| 35 |
+
|
| 36 |
+
| Category | Examples |
|
| 37 |
+
|---|---|
|
| 38 |
+
| Orders | 136 |
|
| 39 |
+
| Shipping | 103 |
|
| 40 |
+
| Payment | 70 |
|
| 41 |
+
| Returns | 59 |
|
| 42 |
+
| Product Info | 34 |
|
| 43 |
+
| Account | 33 |
|
| 44 |
+
| Sizing | 14 |
|
| 45 |
+
| Order Management | 11 |
|
| 46 |
+
| Support | 5 |
|
| 47 |
+
|
| 48 |
+
Each example is a single user question paired with a support-style answer (e.g. order tracking, return policy, payment troubleshooting). Data was cleaned to fix text-encoding artifacts and deduplicated before training.
|
| 49 |
+
|
| 50 |
+
## Intended Use
|
| 51 |
+
|
| 52 |
+
This model is intended for **retail customer-support-style Q&A** within the categories above — e.g. answering questions about order status, return policy, shipping timelines, and payment issues in a tone consistent with the training data.
|
| 53 |
+
|
| 54 |
+
It is **not** intended for:
|
| 55 |
+
- General-purpose assistant use outside customer support
|
| 56 |
+
- Safety-critical or compliance-sensitive support (e.g. legal, medical, financial advice)
|
| 57 |
+
- Production deployment without human review of outputs
|
| 58 |
+
|
| 59 |
+
## Limitations
|
| 60 |
+
|
| 61 |
+
- Trained on a small dataset (467 examples) — behavior on questions outside the categories above is closer to the unmodified base model.
|
| 62 |
+
- Some categories (Sizing, Order Management, Support) have very few examples and may show limited improvement over the base model.
|
| 63 |
+
- Like any fine-tuned language model, it can produce plausible-sounding but incorrect specifics (order numbers, policy details, dates) — outputs should be verified before being shown to real customers.
|
| 64 |
+
- English only.
|
| 65 |
+
|
| 66 |
+
## How to Use
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
from unsloth import FastLanguageModel
|
| 70 |
+
|
| 71 |
+
model, tokenizer = FastLanguageModel.from_pretrained("00harshh/phi3-mini-support-bot")
|
| 72 |
+
FastLanguageModel.for_inference(model)
|
| 73 |
+
|
| 74 |
+
messages = [{"role": "user", "content": "Where is my order?"}]
|
| 75 |
+
inputs = tokenizer.apply_chat_template(
|
| 76 |
+
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
|
| 77 |
+
).to("cuda")
|
| 78 |
+
|
| 79 |
+
outputs = model.generate(input_ids=inputs, max_new_tokens=150, temperature=0.7, top_p=0.9)
|
| 80 |
+
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Training Procedure
|
| 84 |
+
|
| 85 |
+
- **LoRA config:** r=16, alpha=16, dropout=0, target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 86 |
+
- **Optimizer:** adamw_8bit
|
| 87 |
+
- **Learning rate:** 2e-4, linear schedule
|
| 88 |
+
- **Epochs:** 3
|
| 89 |
+
- **Effective batch size:** 16 (batch size 4 × gradient accumulation 4)
|