Downloads · 30 days
12
24% of all-time downloads
vrashitsura/malyalam_model
malyalam_model is a machine learning model from vrashitsura. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
12
24% of all-time downloads
All-time downloads
50
Public
Repo size
8.4 MB
Likes
0
Public
Click a slice to open those files.
.json9.3 MB · 53%
From the Hugging Face model README
import torch
import pandas as pd
from transformers import AutoModelForCausalLM, AutoTokenizer
device = torch.device("cpu") #change teh device according to you need
model_name = "/root/kubernetes_files/merge/merged_model" # Change to your model tokenizer = AutoTokenizer.from_pretrained(model_name) tokenizer.pad_token = tokenizer.eos_token model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16) model = model.to(device)
instruction = "ആരോഗ്യത്തോടെയിരിക്കാൻ മൂന്ന് നുറുങ്ങുകൾ നൽകുക."
text = f"ഒരു ടാസ്ക്കിനെ വിവരിക്കുന്ന ഒരു നിർദ്ദേശം താഴെ കൊടുത്തിരിക്കുന്നു. അഭ്യർത്ഥന ഉചിതമായി പൂർത്തിയാക്കുന്ന ഒരു പ്രതികരണം എഴുതുക.## നിർദ്ദേശം:\n{instruction} ## പ്രതികരണം:"
input_ids = tokenizer(instruction, return_tensors="pt", padding='max_length', max_length = 128)
input_ids = input_ids.to(device)
with torch.no_grad():
output = model.generate(**input_ids,max_new_tokens = 128 ) # Adjust max_length as needed
result = tokenizer.decode(output[0], skip_special_tokens=True)
print(result)