Views
No views yet
who is the chairman of dev bhoomi uttarakhand university?1The Chairman of Dev Bhoomi Uttarakhand University is Shri Sanjay Bansal.
2He is a well-known businessman and philanthropist who has made significant contributions to the field of education.
3Under his leadership, the university has made tremendous progress and has established itself as a premier institution of higher learning in the region.1import re
2from transformers import AutoTokenizer, LlamaForCausalLM
3import torch
4
5model_name = "FalconX80/NisoriV2llama7b"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = LlamaForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map="auto")
8
9def chat(prompt):
10 inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
11 outputs = model.generate(inputs.input_ids, max_length=200)
12 text = tokenizer.decode(outputs[0], skip_special_tokens=True)
13
14 # Cleaning (remove [INST] tokens and repeated prompt)
15 if text.lower().startswith(prompt.lower()):
16 text = text[len(prompt):].strip()
17 text = re.sub(r"\[/?INST\]", "", text).strip()
18
19 return text
20
21print(chat("Tell me about Dev Bhoomi Uttarakhand University"))