ydshieh HF Staff commited on
Commit
f7fafcf
·
verified ·
1 Parent(s): 89e6ec1

Update md.py

Browse files
Files changed (1) hide show
  1. md.py +2 -2
md.py CHANGED
@@ -4,14 +4,14 @@ import requests
4
  from PIL import Image, ImageDraw
5
  from transformers import AutoProcessor, Kosmos2_5ForConditionalGeneration
6
 
7
- repo = "microsoft/kosmos-2.5"
8
  device = "cuda:0"
9
  dtype = torch.bfloat16
10
  model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, torch_dtype=dtype)
11
  processor = AutoProcessor.from_pretrained(repo)
12
 
13
  # sample image
14
- url = "https://huggingface.co/microsoft/kosmos-2.5/blob/main/receipt_00008.png"
15
  image = Image.open(requests.get(url, stream=True).raw)
16
 
17
  prompt = "<md>"
 
4
  from PIL import Image, ImageDraw
5
  from transformers import AutoProcessor, Kosmos2_5ForConditionalGeneration
6
 
7
+ repo = "ydshieh/kosmos-2.5"
8
  device = "cuda:0"
9
  dtype = torch.bfloat16
10
  model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, torch_dtype=dtype)
11
  processor = AutoProcessor.from_pretrained(repo)
12
 
13
  # sample image
14
+ url = "https://huggingface.co/ydshieh/kosmos-2.5/blob/main/receipt_00008.png"
15
  image = Image.open(requests.get(url, stream=True).raw)
16
 
17
  prompt = "<md>"