File size: 417 Bytes
7823f58 |
1 2 3 4 5 6 7 8 9 |
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained('c:\\Users\\DHEERAJ\\Desktop\\Model files')
model = AutoModelForCausalLM.from_pretrained('c:\\Users\\DHEERAJ\\Desktop\\Model files', use_safetensors=True)
input_text = "Hello, how are you?"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0])) |