Update README.md
Browse files
README.md
CHANGED
@@ -39,12 +39,11 @@ tokenizer = AutoTokenizer.from_pretrained("pszemraj/pythia-6.9b-HC3")
|
|
39 |
|
40 |
model = AutoModelForCausalLM.from_pretrained(
|
41 |
"pszemraj/pythia-6.9b-HC3", load_in_8bit=True, device_map="auto"
|
42 |
-
)
|
43 |
|
44 |
prompt = "I was wondering how much wood a woodchuck could chuck? <answer>"
|
45 |
-
inputs = tokenizer(prompt, return_tensors="pt")
|
46 |
-
|
47 |
-
outputs = model.generate(**inputs, max_new_tokens=300)
|
48 |
result = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
49 |
|
50 |
import pprint as pp
|
|
|
39 |
|
40 |
model = AutoModelForCausalLM.from_pretrained(
|
41 |
"pszemraj/pythia-6.9b-HC3", load_in_8bit=True, device_map="auto"
|
42 |
+
) # shards are ~4GB each
|
43 |
|
44 |
prompt = "I was wondering how much wood a woodchuck could chuck? <answer>"
|
45 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
46 |
+
outputs = model.generate(**inputs, max_new_tokens=300) # default generation config (+ 300 tokens)
|
|
|
47 |
result = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
48 |
|
49 |
import pprint as pp
|