Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "deepkaria/deepseek-r1-1.5b-indian-culture"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name)
6
7prompt = """Below is an instruction that describes a task, paired with an input that provides further context.
8Write a response that appropriately addresses the instruction.
9
10### Instruction:
11You are an expert on Indian culture, traditions, and heritage. Provide detailed and accurate information about the following aspect of Indian culture.
12
13### Input:
14Tell me about Kathakali from Kerala.
15
16### Response:
17"""
18
19inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
20outputs = model.generate(
21 **inputs,
22 max_new_tokens=512,
23 temperature=0.7,
24 top_p=0.9,
25 do_sample=True
26)
27print(tokenizer.decode(outputs[0], skip_special_tokens=True))