Text Generation
Transformers
Safetensors
gemma
unsloth
conversational
Inference Endpoints
text-generation-inference
File size: 5,087 Bytes
a242937
 
 
 
898a38d
 
 
 
 
a242937
 
 
 
 
898a38d
a242937
898a38d
 
a242937
 
 
 
 
 
 
 
 
 
898a38d
 
 
a242937
 
 
 
 
898a38d
a242937
 
 
 
898a38d
a242937
 
 
 
898a38d
a242937
 
 
 
 
 
 
 
 
 
 
898a38d
 
a242937
898a38d
 
a242937
898a38d
 
a242937
898a38d
 
 
 
 
 
a242937
898a38d
a242937
898a38d
a242937
898a38d
 
 
 
 
 
 
 
 
 
 
 
a242937
898a38d
 
 
a242937
898a38d
a242937
898a38d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a242937
898a38d
a242937
898a38d
a242937
 
898a38d
 
 
 
 
 
 
 
 
a242937
898a38d
 
 
a242937
 
898a38d
a242937
898a38d
 
 
a242937
898a38d
 
 
 
a242937
898a38d
 
 
 
a242937
 
898a38d
a242937
 
 
898a38d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
library_name: transformers
tags:
- unsloth
datasets:
- Telugu-LLM-Labs/yahma_alpaca_cleaned_telugu_filtered_and_romanized
- >-
  Telugu-LLM-Labs/teknium_GPTeacher_general_instruct_telugu_filtered_and_romanized
pipeline_tag: text-generation
---

# Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->
Gemma 2B Model Finetuned on two Telugu Instruct Datasets:

1. Telugu-LLM-Labs/yahma_alpaca_cleaned_telugu_filtered_and_romanized
2. Telugu-LLM-Labs/teknium_GPTeacher_general_instruct_telugu_filtered_and_romanized


## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->

This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.

- **Developed by:** Sai Teja Mummadi
- **Language(s) (NLP):** English, Telugu (Original Script and Transliterated(Romanized))
- **Finetuned from model:** google/gemma-2b


## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
Text Generation, Telugu Chatbot, Telugu Text Generation

### Downstream Use [optional]

<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
Telugu Text Summarization, Further Finetuning on Telugu Datasets

## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->
Model is still under development, might need further finetuning on other datasets

### Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

## How to Get Started with the Model

Use the code below to get started with the model.

```
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
{}

### Input:
{}

### Response:
{}"""
```
```
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

model_name = "TeluguHouseCollective/Gemma-2B-Telugu_Instruct_Finetuned"

tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side="right")
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16).to(device)
```
```
inputs = tokenizer(
[
    alpaca_prompt.format(
        "fibonacci series rayadaniki python program ivvu", # instruction
        "", # input
        "", # output - leave this blank for generation!
    )
], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens = 256, use_cache = True)
tokenizer.batch_decode(outputs)
```

Model Output was as following:

```
Response:\nfibonnaci rayadaniki python program ikkada vundi:\n\n\'\'\'\n
def fibonacci(n):\n    """\n    fibonacci series rayadaniki python program.\n    """\n
a = 0\n    b = 1\n    series = [a, b]\n
for i in range(2, n + 1):\n
series.append(a + b)\n
a, b = b, a + b\n
return series\n\n#
fibonacci series rayadaniki 10 vibhinna sankhyalanu rayandi\n
series = fibonacci(10)\nprint(series)\n\'\'\'\n\n
e program fibonacci series rayadaniki python language upayogistamdi
mariyu fibonacci(n) function upayoginchi fibonacci(n) sankhyanu
rayadaniki fibonacci(n) function upayogistamdi.
fibonacci(n) function yokka prarambha viluvanu 0 mariyu 1 set cheyadam dwara prarambhamavuthundi,
mariyu idi fibonacci(n) yokka prarambha viluvanu 0 mariyu 1 nundi n nundi 1 nundi 0 varaku prarambhama

```

Another input in telugu


```
inputs = tokenizer(
[
    alpaca_prompt.format(
        "ఆరోగ్యంగా ఉండాలి అంటే ఎం చేయాలి?", # instruction
        "", # input
        "", # output - leave this blank for generation!
    )
], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens = 256, use_cache = True)
tokenizer.batch_decode(outputs)
```


Model Output was as following:

```
### Response:
oka nirdishta anubhavanni batti, miru aaharam mariyu poshanalapai drishti pettavachu. kani, oka nirdishta anubhavanni batti, miru aaharam mariyu poshanalapai drishti pettavachu.

meeru aaharam mariyu poshanalapai drishti pettavachchu,
endukante idi mee aarogyanni meruguparachadamla sahayapaduthundi.
meeru aaharam mariyu poshanalapai drishti pettavachchu, endukante idi mee sarirak srama,
nidra mariyu manasika aarogyanni meruguparachadamla sahayapaduthundi.

meeru aaharam mariyu poshanalapai drishti pettavachchu,
endukante idi mee sarirak srama, nidra mariyu manasika aarogyanni meruguparachadamla sahayapaduthundi.
meeru aaharam mariyu poshanalapai drishti pettavachchu, endukante idi mee sarirak srama,
nidra mariyu manasika aarogyanni meruguparachad


```


## Model Card Authors [optional]
Sai Teja Mummadi