DeathReaper0965
commited on
Commit
•
50a2529
1
Parent(s):
1c256f5
Update README.md
Browse files
README.md
CHANGED
@@ -43,12 +43,12 @@ import torch
|
|
43 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
44 |
|
45 |
# Load Code Generator LLM and tokenizer from checkpoint
|
46 |
-
tokenizer = AutoTokenizer.from_pretrained("DeathReaper0965/gpt2_large_code_generator
|
47 |
-
model = AutoModelForCausalLM.from_pretrained("DeathReaper0965/gpt2_large_code_generator
|
48 |
-
|
49 |
model = model.to("cuda" if torch.cuda.is_available() else "cpu")
|
50 |
|
51 |
-
inputs = tokenizer("def hello_world():", return_tensors="pt").to("cuda")
|
|
|
52 |
outputs = model.generate(**inputs,
|
53 |
max_new_tokens= 30,
|
54 |
temperature= 0.5,
|
|
|
43 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
44 |
|
45 |
# Load Code Generator LLM and tokenizer from checkpoint
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained("DeathReaper0965/gpt2_large_code_generator")
|
47 |
+
model = AutoModelForCausalLM.from_pretrained("DeathReaper0965/gpt2_large_code_generator")
|
|
|
48 |
model = model.to("cuda" if torch.cuda.is_available() else "cpu")
|
49 |
|
50 |
+
inputs = tokenizer("def hello_world():", return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
|
51 |
+
|
52 |
outputs = model.generate(**inputs,
|
53 |
max_new_tokens= 30,
|
54 |
temperature= 0.5,
|