anitha2520 commited on
Commit
0f5e181
·
verified ·
1 Parent(s): 5797add

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -3
README.md CHANGED
@@ -1,3 +1,134 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - ta
5
+ ---
6
+
7
+ # **Debug Divas: Colloquial Tamil Translation Model**
8
+ 🚀 **Fine-tuned Mistral-7B for English-to-Colloquial Tamil Translation**
9
+
10
+ ![Hugging Face](https://img.shields.io/badge/HuggingFace-Model-yellow?style=flat)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
12
+
13
+ ## 🌟 **Overview**
14
+ This model is a **fine-tuned version of Mistral-7B** using **Unsloth's FastLanguageModel**, designed specifically to translate **English text into colloquial Tamil** (spoken Tamil). It is optimized for **real-world Tamil conversations**, making it useful for chatbots, assistants, and translation tools.
15
+
16
+ ---
17
+
18
+ ## 📖 **Model Details**
19
+ - **Base Model**: [Mistral-7B-Instruct](https://huggingface.co/mistral-7b-instruct)
20
+ - **Fine-Tuned Dataset**: Custom dataset (`debug_divas_dataset.json`) with **English → Colloquial Tamil** translation pairs.
21
+ - **Training Library**: [Unsloth](https://github.com/unslothai/unsloth) (optimized training for large models)
22
+ - **Max Sequence Length**: 128 tokens
23
+ - **Batch Size**: 8
24
+ - **Epochs**: 3
25
+ - **Optimizer**: AdamW
26
+
27
+ ---
28
+
29
+ ## 🔧 **Installation & Setup**
30
+ To use this model, install the necessary dependencies:
31
+
32
+ ```bash
33
+ pip install torch transformers datasets unsloth accelerate
34
+ ```
35
+
36
+ ---
37
+
38
+ ## 🚀 **Usage**
39
+ ### **Load Model & Tokenizer**
40
+ ```python
41
+ import torch
42
+ from transformers import AutoModelForCausalLM, AutoTokenizer
43
+
44
+ # Load fine-tuned model from Hugging Face
45
+ model_name = "your-huggingface-username/debug-divas-tamil-translation"
46
+ device = "cuda" if torch.cuda.is_available() else "cpu"
47
+
48
+ model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
49
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
50
+
51
+ # Translation function
52
+ def translate_english_to_tamil(input_text):
53
+ instruction = "Translate the following English sentence to colloquial Tamil"
54
+ inputs = tokenizer(f"{instruction}: {input_text}", return_tensors="pt").to(device)
55
+
56
+ translated_tokens = model.generate(**inputs, max_length=128)
57
+ translated_text = tokenizer.decode(translated_tokens[0], skip_special_tokens=True)
58
+
59
+ return translated_text
60
+
61
+ # Example usage
62
+ input_text = "The pharmacy is near the bus stop."
63
+ translated_text = translate_english_to_tamil(input_text)
64
+ print("Colloquial Tamil:", translated_text)
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 📝 **Example Outputs**
70
+ | **English** | **Colloquial Tamil Translation** |
71
+ |------------|---------------------------------|
72
+ | "How are you?" | "நீங்க எப்படி இருக்கீங்க?" |
73
+ | "I am going to the market." | "நான் மார்க்கெட்டுக்கு பொறேன்." |
74
+ | "The pharmacy is near the bus stop." | "மருந்துக் கடை பஸ்ஸ்டாப் அருகே இருக்க." |
75
+
76
+ ---
77
+
78
+ ## 📚 **Dataset**
79
+ The dataset contains **pairs of English sentences** with their **colloquial Tamil translations**.
80
+ Example format:
81
+
82
+ ```json
83
+ [
84
+ {
85
+ "input": "How are you?",
86
+ "output": "நீங்க எப்படி இருக்கீங்க?"
87
+ },
88
+ {
89
+ "input": "I am going to the market.",
90
+ "output": "நான் மார்க்கெட்டுக்கு பொறேன்."
91
+ }
92
+ ]
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 🏗 **Training Details**
98
+ The model was fine-tuned using **UnslothTrainer** with the following hyperparameters:
99
+
100
+ - **Batch Size**: 8
101
+ - **Epochs**: 3
102
+ - **Learning Rate**: 2e-5
103
+ - **FP16 Training**: Disabled
104
+ - **Optimizer**: AdamW
105
+ - **Dataset Split**: 80% Train, 20% Test
106
+
107
+
108
+
109
+ ---
110
+
111
+ ## ⚖ **License & Citation**
112
+ This model is released under the **MIT License**. If you use it in your work, please cite:
113
+
114
+ ```bibtex
115
+ @misc{debugdivas2025,
116
+ author = {Debug Divas},
117
+ title = {Fine-tuned Mistral-7B for Colloquial Tamil Translation},
118
+ year = {2025},
119
+ publisher = {Hugging Face},
120
+ url = {https://huggingface.co/your-huggingface-username/debug-divas-tamil-translation}
121
+ }
122
+ ```
123
+
124
+ ---
125
+
126
+ ## ❤️ **Contributions & Feedback**
127
+ We welcome feedback and contributions! Feel free to open an issue or contribute to our dataset.
128
+
129
+ 📧 **Contact:** [xidanitha@gmail.com]
130
+
131
+ ---
132
+
133
+ This **README.md** ensures that users can easily understand, install, and use your **colloquial Tamil translation model**. 🚀
134
+