Spaces:
No application file
No application file
!pip install transformers accelerate | |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer | |
model = AutoModelForSeq2SeqLM.from_pretrained("LoneStriker/CodeLlama-70b-Instruct-hf-5.0bpw-h6-exl2") | |
tokenizer = AutoTokenizer.from_pretrained("LoneStriker/CodeLlama-70b-Instruct-hf-5.0bpw-h6-exl2") | |
input_text = "Write me a short poem about the beauty of the night sky." | |
inputs = tokenizer(input_text, return_tensors="pt") | |
outputs = model.generate(**inputs, max_length=50) | |
generated_text = tokenizer.decode(outputs[0][:50]) | |
print(generated_text) |