ilu000 commited on
Commit
d5781ac
1 Parent(s): 6506779

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -39,7 +39,7 @@ from transformers import pipeline
39
 
40
  generate_text = pipeline(
41
  model="h2oai/h2ogpt-gm-oasst1-multilang-2048-falcon-7b",
42
- torch_dtype=torch.float16,
43
  trust_remote_code=True,
44
  use_fast=False,
45
  device_map={"": "cuda:0"},
@@ -83,7 +83,7 @@ tokenizer = AutoTokenizer.from_pretrained(
83
  )
84
  model = AutoModelForCausalLM.from_pretrained(
85
  "h2oai/h2ogpt-gm-oasst1-multilang-2048-falcon-7b",
86
- torch_dtype=torch.float16,
87
  device_map={"": "cuda:0"}
88
  )
89
  generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
@@ -113,7 +113,7 @@ model_name = "h2oai/h2ogpt-gm-oasst1-multilang-2048-falcon-7b" # either local f
113
  prompt = "<|prompt|>How are you?<|endoftext|><|answer|>"
114
 
115
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
116
- model = AutoModelForCausalLM.from_pretrained(model_name)
117
  model.cuda().eval()
118
  inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
119
 
 
39
 
40
  generate_text = pipeline(
41
  model="h2oai/h2ogpt-gm-oasst1-multilang-2048-falcon-7b",
42
+ torch_dtype=torch.bfloat16,
43
  trust_remote_code=True,
44
  use_fast=False,
45
  device_map={"": "cuda:0"},
 
83
  )
84
  model = AutoModelForCausalLM.from_pretrained(
85
  "h2oai/h2ogpt-gm-oasst1-multilang-2048-falcon-7b",
86
+ torch_dtype=torch.bfloat16,
87
  device_map={"": "cuda:0"}
88
  )
89
  generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
 
113
  prompt = "<|prompt|>How are you?<|endoftext|><|answer|>"
114
 
115
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
116
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
117
  model.cuda().eval()
118
  inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
119