初始化项目,由ModelHub XC社区提供模型
Model: Ephraimmm/customer-service Source: Original Platform
This commit is contained in:
111
README.md
Normal file
111
README.md
Normal file
@@ -0,0 +1,111 @@
|
||||
---
|
||||
base_model: unsloth/gemma-3-4b-it-unsloth-bnb-4bit
|
||||
tags:
|
||||
- text-generation-inference
|
||||
- transformers
|
||||
- unsloth
|
||||
- gemma3
|
||||
license: apache-2.0
|
||||
language:
|
||||
- en
|
||||
pipeline_tag: text-generation
|
||||
---
|
||||
|
||||
# Nigerian Bank Customer Service Assistant
|
||||
|
||||
## Overview
|
||||
|
||||
This is a [Gemma-3-4B](https://huggingface.co/unsloth/gemma-3-4b-it-unsloth-bnb-4bit) instruction-tuned model fine-tuned to handle customer service conversations for a Nigerian bank. The fine-tuning data reflects Nigerian customer-service interactions, so the model's responses are tuned to Nigerian tone and phrasing patterns as they appear in text (e.g. common Nigerian English expressions and code-switching seen in chat/support transcripts). It was trained with [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face's TRL library using parameter-efficient (LoRA) fine-tuning.
|
||||
|
||||
## Training Details
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Base model | [unsloth/gemma-3-4b-it-unsloth-bnb-4bit](https://huggingface.co/unsloth/gemma-3-4b-it-unsloth-bnb-4bit) (Gemma 3, 4B, 4-bit quantized) |
|
||||
| Method | Supervised fine-tuning with LoRA (via [Unsloth](https://github.com/unslothai/unsloth) + Hugging Face TRL) |
|
||||
| LoRA rank (r) | 8 |
|
||||
| LoRA alpha | 8 |
|
||||
| LoRA dropout | 0 |
|
||||
| Target modules | Attention projections (`q_proj`, `k_proj`, `v_proj`, `o_proj`) and MLP projections (`gate_proj`, `up_proj`, `down_proj`) of the language model |
|
||||
| Task type | Causal LM |
|
||||
| Precision | float16 |
|
||||
|
||||
This repository hosts the full fine-tuned model weights (merged, fp16, split across two safetensors shards) as well as the standalone LoRA adapter (`adapter_model.safetensors`) used to produce them, so the adapter can also be applied on top of the base model directly if preferred.
|
||||
|
||||
Training data, dataset size, and number of training steps/epochs are not recorded in this repository's metadata and are not published here.
|
||||
|
||||
## Intended Use
|
||||
|
||||
- Financial services customer support conversations
|
||||
- Loan application assistance and status inquiries
|
||||
- Chat-based customer interaction with Nigerian tone and accent patterns in text
|
||||
|
||||
This model is intended as a domain-specific assistant for Nigerian banking customer service scenarios rather than as a general-purpose chat model.
|
||||
|
||||
## How to Use
|
||||
|
||||
The repository contains the full merged model, so it can be loaded directly with `transformers` (no separate adapter step required):
|
||||
|
||||
```python
|
||||
import torch
|
||||
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
|
||||
|
||||
model_id = "Ephraimmm/customer-service"
|
||||
|
||||
model = Gemma3ForConditionalGeneration.from_pretrained(
|
||||
model_id,
|
||||
device_map="auto",
|
||||
torch_dtype=torch.float16,
|
||||
)
|
||||
processor = AutoProcessor.from_pretrained(model_id)
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": [{"type": "text", "text": "Good day, please I want to check on my loan application status."}]}
|
||||
]
|
||||
|
||||
inputs = processor.apply_chat_template(
|
||||
messages,
|
||||
add_generation_prompt=True,
|
||||
tokenize=True,
|
||||
return_dict=True,
|
||||
return_tensors="pt",
|
||||
).to(model.device)
|
||||
|
||||
with torch.no_grad():
|
||||
output_ids = model.generate(**inputs, max_new_tokens=256)
|
||||
|
||||
response = processor.decode(
|
||||
output_ids[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True
|
||||
)
|
||||
print(response)
|
||||
```
|
||||
|
||||
Alternatively, load with Unsloth for faster inference:
|
||||
|
||||
```python
|
||||
from unsloth import FastModel
|
||||
|
||||
model, tokenizer = FastModel.from_pretrained(
|
||||
model_name="Ephraimmm/customer-service",
|
||||
max_seq_length=2048,
|
||||
load_in_4bit=True,
|
||||
)
|
||||
FastModel.for_inference(model)
|
||||
```
|
||||
|
||||
If you only want the LoRA weights, `adapter_config.json` / `adapter_model.safetensors` in this repo can be loaded on top of the base model `unsloth/gemma-3-4b-it-unsloth-bnb-4bit` with `peft`.
|
||||
|
||||
## Limitations
|
||||
|
||||
- This is a domain-specific model tuned for a narrow use case (Nigerian bank customer service, loan-related queries); it has not been evaluated against standard NLP/LLM benchmarks.
|
||||
- No formal evaluation metrics, accuracy figures, or benchmark scores are published for this model — do not assume performance figures not stated here.
|
||||
- As with any fine-tuned LLM, outputs should be reviewed before use in a production financial-services context, particularly for compliance-sensitive communication.
|
||||
- The base architecture (Gemma 3) supports multimodal (image+text) input, but this fine-tune was produced for text-based customer service interaction.
|
||||
|
||||
## Author
|
||||
|
||||
Developed by [Ephraimmm](https://huggingface.co/Ephraimmm)
|
||||
|
||||
This gemma3 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face's TRL library.
|
||||
|
||||
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
||||
Reference in New Issue
Block a user