Spaces:
Runtime error
Runtime error
File size: 537 Bytes
2d633cd 9c82439 f8a241e |
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-2-70b-chat-hf")
model = AutoModelForCausalLM.from_pretrained("TheCraftySlayer/Llama-2-70b-chat-hf")
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)}") |