pseudotensor
commited on
Commit
·
c6bb0fe
1
Parent(s):
548099e
Update README.md
Browse files
README.md
CHANGED
@@ -41,7 +41,7 @@ pip install accelerate==0.18.0
|
|
41 |
import torch
|
42 |
from transformers import pipeline
|
43 |
|
44 |
-
generate_text = pipeline(model="h2oai/h2ogpt-oasst1-512-12b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
45 |
|
46 |
res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
|
47 |
print(res[0]["generated_text"])
|
@@ -57,7 +57,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
57 |
|
58 |
tokenizer = AutoTokenizer.from_pretrained("h2oai/h2ogpt-oasst1-512-12b", padding_side="left")
|
59 |
model = AutoModelForCausalLM.from_pretrained("h2oai/h2ogpt-oasst1-512-12b", torch_dtype=torch.bfloat16, device_map="auto")
|
60 |
-
generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
|
61 |
|
62 |
res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
|
63 |
print(res[0]["generated_text"])
|
|
|
41 |
import torch
|
42 |
from transformers import pipeline
|
43 |
|
44 |
+
generate_text = pipeline(model="h2oai/h2ogpt-oasst1-512-12b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto", prompt_type='human_bot')
|
45 |
|
46 |
res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
|
47 |
print(res[0]["generated_text"])
|
|
|
57 |
|
58 |
tokenizer = AutoTokenizer.from_pretrained("h2oai/h2ogpt-oasst1-512-12b", padding_side="left")
|
59 |
model = AutoModelForCausalLM.from_pretrained("h2oai/h2ogpt-oasst1-512-12b", torch_dtype=torch.bfloat16, device_map="auto")
|
60 |
+
generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer, prompt_type='human_bot')
|
61 |
|
62 |
res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
|
63 |
print(res[0]["generated_text"])
|