Downloads · 30 days
15
2% of all-time downloads
TeluguHouseCollective/Gemma-2B-Telugu_Instruct_Finetuned
Gemma-2B-Telugu_Instruct_Finetuned is a text generation model from TeluguHouseCollective. Use it when you need the model to write or continue text. It is set up for transformers.
Gemma 2B Model Finetuned on two Telugu Instruct Datasets:
Downloads · 30 days
15
2% of all-time downloads
All-time downloads
778
Public
Parameters
2.5B
5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5 GB · 100%
From the Hugging Face model README
Gemma 2B Model Finetuned on two Telugu Instruct Datasets:
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Text Generation, Telugu Chatbot, Telugu Text Generation
Telugu Text Summarization, Further Finetuning on Telugu Datasets
Model is still under development, might need further finetuning on other datasets
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
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
Sai Teja Mummadi