You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modeling_llama=importlib.reload(transformers.models.llama.modeling_llama)
model=modeling_llama.LlamaForCausalLM.from_pretrained(checkpoint_path)
tokenizer=transformers.AutoTokenizer.from_pretrained(checkpoint_path)
# Add text generationprompt="Write a short story about a robot learning to paint:"inputs=tokenizer(prompt, return_tensors="pt")
outputs=model.generate(
inputs.input_ids,
max_length=200,
num_return_sequences=1,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
generated_text=tokenizer.decode(outputs[0], skip_special_tokens=True)
print("\nGenerated text:")
print(generated_text)
See #1410, has not been resolved as of yet.
The text was updated successfully, but these errors were encountered: