Avishka commited on
Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- si
|
| 4 |
+
- ta
|
| 5 |
+
- en
|
| 6 |
+
license: other
|
| 7 |
+
tags:
|
| 8 |
+
- qwen
|
| 9 |
+
- qlora
|
| 10 |
+
- cpt
|
| 11 |
+
- sri-lanka
|
| 12 |
+
- sinhala
|
| 13 |
+
- tamil
|
| 14 |
+
model_type: causal-lm
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
base_model: qwen3.5-4b
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Chat2Find-CPT: Qwen 3.5 4B (Sri Lankan Continued Pre-Training)
|
| 20 |
+
|
| 21 |
+
Chat2Find-CPT is a specialized version of the Qwen 3.5 4B model, enhanced via **Continued Pre-Training (CPT)** using **QLoRA (4-bit)** to excel in Sri Lankan linguistic and cultural contexts. It features robust proficiency in **Sinhala**, **Tamil**, and English.
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
- **Developed by:** Sentient (Chat2Find)
|
| 26 |
+
- **Base Model:** Qwen 3.5-4B
|
| 27 |
+
- **Training Method:** Continued Pre-Training (CPT) with QLoRA
|
| 28 |
+
- **Languages:** Sinhala (si), Tamil (ta), English (en)
|
| 29 |
+
- **Quantization:** 4-bit (bitsandbytes)
|
| 30 |
+
|
| 31 |
+
## Technical Specifications
|
| 32 |
+
|
| 33 |
+
### Training Hardware
|
| 34 |
+
- **GPU:** NVIDIA GeForce RTX 3060 (12GB VRAM)
|
| 35 |
+
- **Frameworks:** Unsloth, Hugging Face Transformers, PEFT
|
| 36 |
+
|
| 37 |
+
### Training Hyperparameters
|
| 38 |
+
- **Method:** QLoRA (Rank 32, Alpha 32)
|
| 39 |
+
- **Learning Rate:** 5e-5 (Cosine Scheduler)
|
| 40 |
+
- **Optimizer:** AdamW (8-bit)
|
| 41 |
+
- **Epochs:** 1.0
|
| 42 |
+
- **Sequence Length:** 2048 tokens
|
| 43 |
+
- **Batch Size:** 2 (local) / 8 (global with Gradient Accumulation)
|
| 44 |
+
|
| 45 |
+
### Dataset
|
| 46 |
+
The model was trained on a curated corpus of ~270,000 sequences focusing on:
|
| 47 |
+
- **Sri Lankan News & Media:** Current events and reporting styles.
|
| 48 |
+
- **Business & Logistics:** Domain-specific data from Lankabizz and local commerce.
|
| 49 |
+
- **Cultural Context:** General web-scraped data reflecting local nuances.
|
| 50 |
+
|
| 51 |
+
## Capabilities
|
| 52 |
+
|
| 53 |
+
Chat2Find-CPT excels at:
|
| 54 |
+
1. **Sinhala & Tamil Generation:** Fluent and contextually relevant text generation.
|
| 55 |
+
2. **Code-Switching:** Handling natural language mixes common in Sri Lankan communication.
|
| 56 |
+
3. **Local Knowledge:** Understanding entities, locations, and cultural references specific to Sri Lanka.
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
|
| 60 |
+
### Using Unsloth (Recommended for Speed)
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from unsloth import FastLanguageModel
|
| 64 |
+
import torch
|
| 65 |
+
|
| 66 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 67 |
+
model_name = "SENTIENT_ID/Chat2Find-CPT",
|
| 68 |
+
max_seq_length = 2048,
|
| 69 |
+
load_in_4bit = True,
|
| 70 |
+
)
|
| 71 |
+
FastLanguageModel.for_inference(model)
|
| 72 |
+
|
| 73 |
+
inputs = tokenizer(
|
| 74 |
+
["ශ්රී ලංකාව ගැන කෙටි විස්තරයක්:"],
|
| 75 |
+
return_tensors = "pt"
|
| 76 |
+
).to("cuda")
|
| 77 |
+
|
| 78 |
+
outputs = model.generate(**inputs, max_new_tokens = 256)
|
| 79 |
+
print(tokenizer.batch_decode(outputs))
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### Using Standard Transformers
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 86 |
+
|
| 87 |
+
model_name = "SENTIENT_ID/Chat2Find-CPT"
|
| 88 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 89 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
| 90 |
+
|
| 91 |
+
# Note: The model is a merged 16-bit weight set.
|
| 92 |
+
# You can load it in 4-bit/8-bit using BitsAndBytes.
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
## Limitations & Bias
|
| 96 |
+
|
| 97 |
+
While Chat2Find-CPT is significantly better at local languages than the base Qwen model, it may still exhibit biases present in the training data or the base model's internal knowledge. Users are encouraged to perform their own safety checks for specific deployment scenarios.
|
| 98 |
+
|
| 99 |
+
## License
|
| 100 |
+
|
| 101 |
+
This model is subject to the original **Qwen License Agreement**.
|