drawall-1o / README.md
Hwang16's picture
Update README.md
79e5945 verified
metadata
license: artistic-2.0

pip install transformers torch

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B") model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")

input_text = "Xin chào! Bạn có thể giúp gì cho tôi?" input_ids = tokenizer(input_text, return_tensors="pt").input_ids outputs = model.generate(input_ids, max_length=100) print(tokenizer.decode(outputs[0], skip_special_tokens=True))