Hwang16 commited on
Commit
79e5945
1 Parent(s): cad24eb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -3
README.md CHANGED
@@ -1,3 +1,14 @@
1
- ---
2
- license: artistic-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: artistic-2.0
3
+ ---
4
+ pip install transformers torch
5
+
6
+ from transformers import AutoModelForCausalLM, AutoTokenizer
7
+
8
+ tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B")
9
+ model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")
10
+
11
+ input_text = "Xin chào! Bạn có thể giúp gì cho tôi?"
12
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids
13
+ outputs = model.generate(input_ids, max_length=100)
14
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))