Downloads · 30 days
939
2% of all-time downloads
VietAI/gpt-j-6B-vietnamese-news
gpt-j-6B-vietnamese-news is a text generation model from VietAI. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
939
2% of all-time downloads
All-time downloads
42.8K
Public
Repo size
24.5 GB
Likes
12
Public
Click a slice to open those files.
.bin12.3 GB · 100%
From the Hugging Face model README
Details will be available soon.
For more information, please contact [email protected] (Dương) / [email protected] (Thành) / [email protected] (Bình).
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("VietAI/gpt-j-6B-vietnamese-news")
model = AutoModelForCausalLM.from_pretrained("VietAI/gpt-j-6B-vietnamese-news", low_cpu_mem_usage=True)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
prompt = "Tiềm năng của trí tuệ nhân tạo" # your input sentence
input_ids = tokenizer(prompt, return_tensors="pt")['input_ids'].to(device)
gen_tokens = model.generate(
input_ids,
max_length=max_length,
do_sample=True,
temperature=0.9,
top_k=20,
)
gen_text = tokenizer.batch_decode(gen_tokens)[0]
print(gen_text)