2
File size: 504 Bytes
2d633cd
 
 
f9796f2
 
f8a241e
5a40416
 
f8a241e
 
135f6e4
1
2
3
4
5
6
7
8
9
10
11
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("TheCraftySlayer/llama")
model = AutoModelForCausalLM.from_pretrained("TheCraftySlayer/llama")
input_text =" hello how are you?"
inputs= tokenizer.encode(input_text, return_tensors='pt')
outputs= model.generate(inputs,max_length=50,num_return_sequences=5,temperature=0.7)
print("Generated Text")
for i, output in enumerate(outputs):
    print(f"{i}: {tokenizer.decode(output)}")