Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("notoookay/ragler-llama2-7b")
5model = AutoModelForCausalLM.from_pretrained("notoookay/ragler-llama2-7b", torch_dtype=torch.bfloat16, device_map="auto")
6
7# Example usage
8input_text = "### Instruction:\nAnswer the following question.\n\n### Input:\nQuestion:\nWhat is the capital of France?\n\n### Response:\n"
9inputs = tokenizer(input_text, return_tensors="pt")
10outputs = model.generate(**inputs, max_new_tokens=100)
11print(tokenizer.decode(outputs[0]))