Replace **dtype** with **torch_dtype** in Model Loading

#19
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -33,7 +33,7 @@ from transformers import AutoProcessor, Kosmos2_5ForConditionalGeneration, infer
33
  repo = "microsoft/kosmos-2.5"
34
  device = "cuda:0"
35
  dtype = torch.bfloat16
36
- model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, dtype=dtype)
37
  processor = AutoProcessor.from_pretrained(repo)
38
 
39
  # sample image
@@ -71,7 +71,7 @@ from transformers import AutoProcessor, Kosmos2_5ForConditionalGeneration, infer
71
  repo = "microsoft/kosmos-2.5"
72
  device = "cuda:0"
73
  dtype = torch.bfloat16
74
- model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, dtype=dtype)
75
  processor = AutoProcessor.from_pretrained(repo)
76
 
77
  # sample image
 
33
  repo = "microsoft/kosmos-2.5"
34
  device = "cuda:0"
35
  dtype = torch.bfloat16
36
+ model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, torch_dtype=dtype)
37
  processor = AutoProcessor.from_pretrained(repo)
38
 
39
  # sample image
 
71
  repo = "microsoft/kosmos-2.5"
72
  device = "cuda:0"
73
  dtype = torch.bfloat16
74
+ model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, torch_dtype=dtype)
75
  processor = AutoProcessor.from_pretrained(repo)
76
 
77
  # sample image