Text Generation
Transformers
Safetensors
Telugu
English
Inference Endpoints
File size: 11,017 Bytes
20cf3dd
 
 
 
 
975a8e4
 
 
50238a1
975a8e4
 
 
50238a1
975a8e4
1cd1698
 
50238a1
 
 
 
975a8e4
 
 
 
 
 
 
 
 
 
bdf7ec3
975a8e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bdf7ec3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50238a1
 
 
 
 
 
 
 
 
975a8e4
50238a1
 
 
 
 
 
 
 
 
 
 
 
 
975a8e4
50238a1
 
 
 
 
 
 
 
 
 
 
 
 
56ef217
50238a1
 
 
 
 
 
 
 
56ef217
 
 
50238a1
975a8e4
50238a1
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
---
license: other
license_name: gemma
license_link: LICENSE
---

# Telugu-gemma-2b-finetuned-sft

This model is based on [google/gemma-2b](https://huggingface.co./google/gemma-2b) and hase been LoRA finetuned on instruction datasets:
  1. [yahma_alpaca_cleaned_telugu_filtered_and_romanized](https://huggingface.co./datasets/Telugu-LLM-Labs/yahma_alpaca_cleaned_telugu_filtered_and_romanized)
  2. [teknium_GPTeacher_general_instruct_telugu_filtered_and_romanized](https://huggingface.co./datasets/Telugu-LLM-Labs/teknium_GPTeacher_general_instruct_telugu_filtered_and_romanized)

The model is finetuned using [unsloth](https://github.com/unslothai/unsloth) library and we provide inference code using the same for faster inference. Alternatively you can use HuggingFace Library for inference.

The model is finetuned only on native telugu SFT data from above datasets and we will update the model with transliteration in upcoming days.

# Installation

`!pip install "unsloth[colab-ampere] @git+https://github.com/unslothai/unsloth.git"`

# Input Text Format

```
### Instruction: {instruction}

### Input: {input}

## Response: {response}
```

# Usage with Unsloth

```python3
from unsloth import FastLanguageModel
import torch
max_seq_length = 2048
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
load_in_4bit = False 
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "Telugu-LLM-Labs/Telugu-gemma-2b-finetuned-sft",
    max_seq_length = max_seq_length,
    dtype = dtype,
    load_in_4bit = load_in_4bit,
    device_map="auto"
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference

input_prompt = """
### Instruction:
{}

### Input:
{}

### Response:
{}"""

input_text = input_prompt.format(
        "కింది వచనాన్ని రెండు పాయింట్లలో సంగ్రహించండి.", # instruction
        "Google వార్తలు అనేది Google ద్వారా అభివృద్ధి చేయబడిన వార్తా అగ్రిగేటర్ సేవ. ఇది వేలకొద్దీ ప్రచురణకర్తలు మరియు మ్యాగజైన్‌ల నుండి నిర్వహించబడిన కథనాలకు నిరంతర లింక్‌లను అందిస్తుంది. Google వార్తలు Android, iOS మరియు వెబ్‌లో యాప్‌గా అందుబాటులో ఉన్నాయి. గూగుల్ సెప్టెంబరు 2002లో బీటా వెర్షన్‌ను మరియు జనవరి 2006లో అధికారిక యాప్‌ను విడుదల చేసింది.", # input
        "", # output - leave this blank for generation!
    )

inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")

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

# Usage with HuggingFace

```python3
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer

model = AutoPeftModelForCausalLM.from_pretrained(
    "Telugu-LLM-Labs/Telugu-gemma-2b-finetuned-sft",
    load_in_4bit = False,
    token = hf_token
)
tokenizer = AutoTokenizer.from_pretrained("Telugu-LLM-Labs/Telugu-gemma-2b-finetuned-sft")

input_prompt = """
### Instruction:
{}

### Input:
{}

### Response:
{}"""

input_text = input_prompt.format(
        "కింది వచనాన్ని రెండు పాయింట్లలో సంగ్రహించండి.", # instruction
        "Google వార్తలు అనేది Google ద్వారా అభివృద్ధి చేయబడిన వార్తా అగ్రిగేటర్ సేవ. ఇది వేలకొద్దీ ప్రచురణకర్తలు మరియు మ్యాగజైన్‌ల నుండి నిర్వహించబడిన కథనాలకు నిరంతర లింక్‌లను అందిస్తుంది. Google వార్తలు Android, iOS మరియు వెబ్‌లో యాప్‌గా అందుబాటులో ఉన్నాయి. గూగుల్ సెప్టెంబరు 2002లో బీటా వెర్షన్‌ను మరియు జనవరి 2006లో అధికారిక యాప్‌ను విడుదల చేసింది.", # input
        "", # output - leave this blank for generation!
    )

inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
response = tokenizer.batch_decode(outputs)[0]
```

# Sample Questions and Responses

## Reasoning

### Instruction: 
(5+4)*(2+1)? నాకు దశల వారీ వివరణ ఇవ్వండి. 

### Response:
మీరు మార్కెట్ నుండి 100 యాపిల్స్ కొన్నారు, ఇంటికి వెళ్ళేటప్పుడు మీ అమ్మకు 10 ఆపిల్స్, మీ స్నేహితుడికి 5 ఆపిల్స్ ఇచ్చారు. మీరు ఇప్పుడు మిగిలిన ఆపిల్స్ యొక్క సంఖ్యను కనుగొనాలనుకుంటున్నారు.

మొదట, మీరు అమ్మకు ఇచ్చిన ఆపిల్స్ సంఖ్యను జోడించండి: 10 + 5 = 15.

తరువాత, మీరు ఇప్పుడు మిగిలిన ఆపిల్స్ యొక్క సంఖ్యను కనుగొనాలి. ఇది మొత్తం ఆపిల్స్ సంఖ్య నుండి అమ్మకు ఇచ్చిన ఆపిల్స్ సంఖ్యను తీసివేయడం ద్వారా లెక్కించబడుతుంది: 100 - 15 = 85.

అందువల్ల, మీరు ఇప్పుడు మిగిలిన 85 ఆపిల్స్ ఉన్నారు.

## Content Generation

### Instruction:
కాకి మీద చాలా చిన్న కథ రాయండి

### Response:
ఒకప్పుడు ఒక చిన్న పల్లెటూరులో ఒక కాకి ఉండేది. దానికి మంచి ఆహారం, ఆశ్రయం, ఆశ్రయం ఇవన్నీ ఉన్నాయి. అయితే, అది ఎప్పుడూ తన స్వంత ఆహారాన్ని వండడం లేదని, తన స్వంత ఆశ్రయాన్ని నిర్మించడం లేదని తెలుసు.

ఒక రోజు, కాకి తన స్వంత ఆహారాన్ని వండడానికి ఒక కుండను తయారు చేసింది, మరియు అది తన స్వంత ఆశ్రయాన్ని నిర్మించడానికి ఒక గుడ్డను తయారు చేసింది. అది తన స్వంత ఆహారాన్ని వండడం ప్రారంభించింది, మరియు అది తన స్వంత ఆశ్రయాన్ని నిర్మించడం ప్రారంభించింది.

## Question Answering with Context

### Instruction:
స్నోఫ్లేక్ సీఈవో ఎవరు?

### Input:
స్నోఫ్లేక్ (NYSE: SNOW), డేటా క్లౌడ్ కంపెనీ, ఫ్రాంక్ స్లూట్‌మన్ చీఫ్ ఎగ్జిక్యూటివ్ ఆఫీసర్‌గా పదవీ విరమణ చేయాలని నిర్ణయించుకున్నారని మరియు శ్రీధర్ రామస్వామి చీఫ్ ఎగ్జిక్యూటివ్ ఆఫీసర్‌గా మరియు డైరెక్టర్ల బోర్డు సభ్యునిగా వెంటనే అమలులోకి వచ్చినట్లు ఈరోజు ప్రకటించింది. శ్రీధర్ రామస్వామి గతంలో స్నోఫ్లేక్‌లో AI సీనియర్ వైస్ ప్రెసిడెంట్‌గా ఉన్నారు.

### Response:
స్నోఫ్లేక్ సీఈవో శ్రీధర్ రామస్వామి

## General Question Answering

### Instruction:
Share the strategy to grow audience on Twitter in 3 short points?

### Response:
1. కంటెంట్ క్రియేట్ చేయండి: మీ టార్గెట్ ఆడియన్స్ కోసం సమాచారాత్మక మరియు ఆకర్షణీయమైన కంటెంట్ను సృష్టించడం ద్వారా మీరు మీ ట్రాఫిక్ను పెంచవచ్చు. ఇందులో వ్యాసాలు, చిత్రాలు, వీడియోలు మరియు ఇతర రకాల కంటెంట్ ఉండవచ్చు.
2. ఛాలెంజ్ సెట్ చేయండి: మీరు మీ ప్రేక్షకులతో నిమగ్నం కావడానికి మరియు సంబంధాలను పెంపొందించడానికి సవాలుతో కూడిన పరిస్థితులను సృష్టించండి. ఇందులో ట్రెండ్ లను గుర్తించడం, కొత్త అవకాశాలను అన్వేషించడం మరియు మీ టార్గెట్ ఆడియన్స్ నుండి విలువైన సమాచారాన్ని పొందడం ఉండవచ్చు.
3. నిమగ్నతను పెంచండి: మీ టార్గెట్ ఆడియన్స్తో నిమగ్నం కావడానికి మరియు నిమగ్నం కావడానికి మీరు వారితో నిమగ్నం కావడానికి ప్రోత్సహించండి. ఇందులో ట్యాగ్ లు, ట్వీట్ లు, పోస్ట్ లు లేదా ఇతర రకాల కంటెంట్ ను ఉపయోగించడం ఉండవచ్చు.

---------------------------------------------------------------------------------------------------------------------------------------------

# Developers:

The model is a collaborative effort by [Ravi Theja](https://twitter.com/ravithejads) and [Ramsri Goutham](https://twitter.com/ramsri_goutham). Feel free to DM either of us if you have any questions.