Update README.md
Browse files
README.md
CHANGED
@@ -34,8 +34,32 @@ widget:
|
|
34 |
|
35 |
The Tamil-Mistral-7B-Instruct-v0.2 Large Language Model (LLM) is an improved instruct fine-tuned version of [Tamil-Mistral-7B-Instruct-v0.1](https://huggingface.co/Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1).
|
36 |
Tamil LLM: A Breakthrough in Tamil Language Understanding In the realm of language models, the fine-tuned Tamil Mistral model represents a significant advancement. Unlike its English counterpart, the Tamil Mistral model is specifically tailored to comprehend and generate text in the Tamil language. This innovation addresses a critical gap, as the English Mistral model fails to effectively engage with Tamil, a language rich in culture and heritage. Through extensive fine-tuning with a base Tamil Mistral model, this iteration has been meticulously enhanced to grasp the nuances and intricacies of the Tamil language. As a result, we are delighted to present a revolutionary model that enables seamless interaction through text. Welcome to the future of conversational Tamil language processing with our instructive model.
|
|
|
37 |
|
|
|
|
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
## Instruction format
|
40 |
|
41 |
To harness the power of instruction fine-tuning, your prompt must be encapsulated within <s> and </s> tokens. This instructional format revolves around three key elements: Instruction, Input, and Response. The Tamil Mistral instruct model is adept at engaging in conversations based on this structured template.
|
@@ -64,33 +88,6 @@ prompt_template =<s>"""சரியான பதிலுடன் வேலை
|
|
64 |
|
65 |
```
|
66 |
|
67 |
-
This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
|
68 |
-
|
69 |
-
## Kaggle demo link
|
70 |
-
https://www.kaggle.com/code/hemanthkumar21/tamil-mistral-instruct-v0-1-demo/
|
71 |
-
|
72 |
-
```python
|
73 |
-
from transformers import (AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig,TextStreamer,pipeline)
|
74 |
-
import torch
|
75 |
-
model_name = "Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1"
|
76 |
-
nf4_config = BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,
|
77 |
-
bnb_4bit_compute_dtype=torch.bfloat16
|
78 |
-
)
|
79 |
-
model = AutoModelForCausalLM.from_pretrained(model_name,device_map='auto',quantization_config=nf4_config,use_cache=False,low_cpu_mem_usage=True )
|
80 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
81 |
-
tokenizer.pad_token = tokenizer.eos_token
|
82 |
-
tokenizer.padding_side = "right"
|
83 |
-
streamer = TextStreamer(tokenizer)
|
84 |
-
pipe = pipeline("text-generation" ,model=model, tokenizer=tokenizer ,do_sample=True, repetition_penalty=1.15,top_p=0.95,streamer=streamer)
|
85 |
-
prompt = create_prompt("வாழ்க்கையில் ஆரோக்கியமாக இருப்பது எப்படி?")
|
86 |
-
result=pipe(prompt,max_length=512,pad_token_id=tokenizer.eos_token_id)
|
87 |
-
|
88 |
-
```
|
89 |
-
```
|
90 |
-
result:
|
91 |
-
- உடற்பயிற்சி - ஆரோக்கியமான உணவை உண்ணுங்கள் -2 புகைபிடிக்காதே - தவறாமல் உடற்பயிற்சி செய்</s>
|
92 |
-
```
|
93 |
-
|
94 |
## Python function to format query
|
95 |
```python
|
96 |
def create_prompt(query,prompt_template=prompt_template):
|
@@ -133,4 +130,11 @@ This should not be required after transformers-v4.33.4.
|
|
133 |
|
134 |
The Mistral 7B Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
|
135 |
It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
|
136 |
-
make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
The Tamil-Mistral-7B-Instruct-v0.2 Large Language Model (LLM) is an improved instruct fine-tuned version of [Tamil-Mistral-7B-Instruct-v0.1](https://huggingface.co/Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1).
|
36 |
Tamil LLM: A Breakthrough in Tamil Language Understanding In the realm of language models, the fine-tuned Tamil Mistral model represents a significant advancement. Unlike its English counterpart, the Tamil Mistral model is specifically tailored to comprehend and generate text in the Tamil language. This innovation addresses a critical gap, as the English Mistral model fails to effectively engage with Tamil, a language rich in culture and heritage. Through extensive fine-tuning with a base Tamil Mistral model, this iteration has been meticulously enhanced to grasp the nuances and intricacies of the Tamil language. As a result, we are delighted to present a revolutionary model that enables seamless interaction through text. Welcome to the future of conversational Tamil language processing with our instructive model.
|
37 |
+
|
38 |
|
39 |
+
## Kaggle demo link
|
40 |
+
https://www.kaggle.com/code/hemanthkumar21/tamil-mistral-instruct-v0-1-demo/
|
41 |
|
42 |
+
```python
|
43 |
+
from transformers import (AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig,TextStreamer,pipeline)
|
44 |
+
import torch
|
45 |
+
model_name = "Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1"
|
46 |
+
nf4_config = BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,
|
47 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
48 |
+
)
|
49 |
+
model = AutoModelForCausalLM.from_pretrained(model_name,device_map='auto',quantization_config=nf4_config,use_cache=False,low_cpu_mem_usage=True )
|
50 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
51 |
+
tokenizer.pad_token = tokenizer.eos_token
|
52 |
+
tokenizer.padding_side = "right"
|
53 |
+
streamer = TextStreamer(tokenizer)
|
54 |
+
pipe = pipeline("text-generation" ,model=model, tokenizer=tokenizer ,do_sample=True, repetition_penalty=1.15,top_p=0.95,streamer=streamer)
|
55 |
+
prompt = create_prompt("வாழ்க்கையில் ஆரோக்கியமாக இருப்பது எப்படி?")
|
56 |
+
result=pipe(prompt,max_length=512,pad_token_id=tokenizer.eos_token_id)
|
57 |
+
|
58 |
+
```
|
59 |
+
```
|
60 |
+
result:
|
61 |
+
- உடற்பயிற்சி - ஆரோக்கியமான உணவை உண்ணுங்கள் -2 புகைபிடிக்காதே - தவறாமல் உடற்பயிற்சி செய்</s>
|
62 |
+
```
|
63 |
## Instruction format
|
64 |
|
65 |
To harness the power of instruction fine-tuning, your prompt must be encapsulated within <s> and </s> tokens. This instructional format revolves around three key elements: Instruction, Input, and Response. The Tamil Mistral instruct model is adept at engaging in conversations based on this structured template.
|
|
|
88 |
|
89 |
```
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
## Python function to format query
|
92 |
```python
|
93 |
def create_prompt(query,prompt_template=prompt_template):
|
|
|
130 |
|
131 |
The Mistral 7B Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
|
132 |
It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
|
133 |
+
make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
|
134 |
+
|
135 |
+
## How to Cite
|
136 |
+
@misc{Tamil-Mistral-7B-Instruct-v0.1,
|
137 |
+
url={[https://huggingface.co/Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1]https://huggingface.co/Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1)},
|
138 |
+
title={Tamil-Mistral-7B-Instruct-v0.1},
|
139 |
+
author={"hemanth kuamr"}
|
140 |
+
}
|