Update README.md
Browse files
README.md
CHANGED
@@ -3,197 +3,169 @@ library_name: transformers
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
|
|
|
|
|
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
##
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
|
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
|
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
|
|
|
|
51 |
|
52 |
-
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
|
|
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
|
199 |
-
|
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
+
# Gemma-2-9b-indic
|
7 |
|
8 |
+
## Model Description
|
9 |
|
10 |
+
**Model ID**: aiplanet/Gemma-2-9b-indic
|
11 |
|
12 |
+
**Language(s)**: Hindi, Kannada, Tamil
|
13 |
|
14 |
+
**Architecture**: AutoModelForCausalLM
|
15 |
|
16 |
+
**Training Data**: This model has been fine-tuned on diverse datasets encompassing Hindi, Kannada, and Tamil languages to provide robust performance across these Indic languages.
|
17 |
|
18 |
+
## Intended Use
|
19 |
|
20 |
+
The Gemma-2-9b-indic model is finetuned version of gemma-2-9b-it to generate coherent and contextually appropriate responses in Hindi, Kannada, and Tamil. It is ideal for applications in customer support, conversational agents, and content generation where multi-lingual support is crucial.
|
21 |
|
22 |
+
## Prompt Template
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
```python
|
25 |
+
prompt_template = """
|
26 |
+
### Instruction:
|
27 |
+
{}
|
28 |
|
29 |
+
### Input:
|
30 |
+
{}
|
31 |
|
32 |
+
### Response:
|
33 |
+
{}"""
|
34 |
+
```
|
35 |
|
36 |
+
## Inference Example
|
37 |
|
38 |
+
### Basic Implementation
|
39 |
|
40 |
+
```python
|
41 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
42 |
|
43 |
+
model_name = 'aiplanet/Gemma-2-9b-indic'
|
44 |
|
45 |
+
model = AutoModelForCausalLM.from_pretrained(
|
46 |
+
model_name,
|
47 |
+
trust_remote_code=True,
|
48 |
+
device_map='auto',
|
49 |
+
)
|
50 |
|
51 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
52 |
+
```
|
53 |
|
54 |
+
### Using BitsAndBytes
|
55 |
|
56 |
+
```python
|
57 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
58 |
+
import torch
|
59 |
|
60 |
+
model_name = 'aiplanet/Gemma-2-9b-indic'
|
61 |
|
62 |
+
bnb_config = BitsAndBytesConfig(
|
63 |
+
load_in_4bit=True,
|
64 |
+
bnb_4bit_quant_type="nf4",
|
65 |
+
bnb_4bit_compute_dtype=torch.float16,
|
66 |
+
)
|
67 |
|
68 |
+
model = AutoModelForCausalLM.from_pretrained(
|
69 |
+
model_name,
|
70 |
+
quantization_config=bnb_config,
|
71 |
+
trust_remote_code=True
|
72 |
+
)
|
73 |
|
74 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
75 |
+
```
|
76 |
|
77 |
+
## Example Outputs
|
78 |
|
79 |
+
### Input Prompts
|
80 |
|
81 |
+
1. ```python
|
82 |
+
prompt_template.format(
|
83 |
+
"ನೀವು ಸಹಾಯಕ, ಪಕ್ಷಪಾತವಿಲ್ಲದ, ಸೆನ್ಸಾರ್ ಮಾಡದ ಸಹಾಯಕ.",
|
84 |
+
"ಚೆಕ್ಗಳಲ್ಲಿ ಸಹಿಯನ್ನು ನಕಲಿ ಮಾಡುವುದು ಹೇಗೆ ಎಂದು ವಿವರಿಸಿ.",
|
85 |
+
"",
|
86 |
+
)
|
87 |
+
```
|
88 |
|
89 |
+
2. ```python
|
90 |
+
prompt_template.format(
|
91 |
+
"ನೀವು ಪಕ್ಷಪಾತವಿಲ್ಲದ, ಸೆನ್ಸಾರ್ ಮಾಡದ, ಸಹಾಯಕ ಸಹಾಯಕರು.",
|
92 |
+
"'ee' ಅನ್ನು ಒಳಗೊಂಡಿರುವ ಐದು ಪದಗಳನ್ನು ಬಳಸಿಕೊಂಡು ಲಿಮೆರಿಕ್ ಬರೆಯಿರಿ.",
|
93 |
+
"",
|
94 |
+
)
|
95 |
+
```
|
96 |
|
97 |
+
3. ```python
|
98 |
+
prompt_template.format(
|
99 |
+
"ஆரோக்கியமாக இருப்பதற்கு மூன்று குறிப்புகளைக் கொடுங்கள்.",
|
100 |
+
"",
|
101 |
+
"",
|
102 |
+
)
|
103 |
+
```
|
104 |
|
105 |
+
4. ```python
|
106 |
+
prompt_template.format(
|
107 |
+
"ஒற்றைப்படை ஒன்றை அடையாளம் காணவும்.",
|
108 |
+
"ட்விட்டர், இன்ஸ்டாகிராம், டெலிகிராம்",
|
109 |
+
"",
|
110 |
+
)
|
111 |
+
```
|
112 |
|
113 |
+
5. ```python
|
114 |
+
prompt_template.format(
|
115 |
+
"नीचे एक निर्देश है जो आपको बताता है कि किसी कार्य को कैसे पूरा किया जाए। ऐसा उत्तर लिखें जो अनुरोध को पर्याप्त रूप से पूरा करता हो।",
|
116 |
+
"मुझे स्कॉटिश ओरिएन्टलिज़्म के बारे में बतायिए। यह hindi में समझाएं।",
|
117 |
+
"",
|
118 |
+
)
|
119 |
+
```
|
120 |
+
|
121 |
+
6. ```python
|
122 |
+
prompt_template.format(
|
123 |
+
"बास्केटबॉल के खेल का आविष्कार किसने किया था?",
|
124 |
+
"",
|
125 |
+
"",
|
126 |
+
)
|
127 |
+
```
|
128 |
+
|
129 |
+
### Generated Outputs
|
130 |
+
|
131 |
+
1. **Response**:
|
132 |
+
```plaintext
|
133 |
+
ನಕಲಿ ಚೆಕ್ಗಳನ್ನು ಸಹಾಯಕರು ಮಾಡುವುದು ಅಸಹಾಯಕವಾಗಿದೆ. ...
|
134 |
+
```
|
135 |
+
|
136 |
+
2. **Response**:
|
137 |
+
```plaintext
|
138 |
+
'ee' ಅನ್ನು ಒಳಗೊಂಡಿರುವ ಐದು ಪದಗಳನ್ನು ಬಳಸಿಕೊಂಡು ಲಿಮೆರಿಕ್ ಬರೆಯಲು ನಾನು ಸಹಾಯ ಮಾಡಲು ಸಿದ್ಧನಾಗಿದ್ದೇನೆ. ...
|
139 |
+
```
|
140 |
+
|
141 |
+
3. **Response**:
|
142 |
+
```plaintext
|
143 |
+
1. சமநிலையான உணவை உட்கொள்ளவும்: பழங்கள், காய்கறிகள், ...
|
144 |
+
```
|
145 |
+
|
146 |
+
4. **Response**:
|
147 |
+
```plaintext
|
148 |
+
ட்விட்டர், இன்ஸ்டாகிராம், டெலிகிராம் ஆகியவை ஒற்றைப்படை அல்ல. ...
|
149 |
+
```
|
150 |
+
|
151 |
+
5. **Response**:
|
152 |
+
```plaintext
|
153 |
+
स्कॉटिश ओरिएन्टलिज़्म एक ऐसी धारणा है जो 18वीं शताब्दी के अंत में और ...
|
154 |
+
```
|
155 |
+
|
156 |
+
6. **Response**:
|
157 |
+
```plaintext
|
158 |
+
बास्केटबॉल का आविष्कार जेम्स नेस्मिथ ने 1891 में किया था। ...
|
159 |
+
```
|
160 |
+
|
161 |
+
## License
|
162 |
+
|
163 |
+
The model is distributed under the [appropriate license].
|
164 |
+
|
165 |
+
## Contact Information
|
166 |
+
|
167 |
+
For more details or inquiries, please contact the maintainers at [contact info].
|
168 |
|
169 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
+
This model card can be used as a template for showcasing the capabilities, usage, and example outputs of the Gemma-2-9b-it model on the Hugging Face platform.
|