amokrov commited on
Commit
f430f8d
·
verified ·
1 Parent(s): d25ce0d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -4
README.md CHANGED
@@ -48,6 +48,7 @@ import requests
48
  from optimum.intel.openvino import OVModelForVisualCausalLM
49
  from transformers import AutoProcessor, TextStreamer
50
 
 
51
  model_id = "OpenVINO/pixtral-12b-int4-ov"
52
 
53
  processor = AutoProcessor.from_pretrained(model_id)
@@ -59,12 +60,10 @@ messages = [
59
  ]
60
  text = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
61
 
62
-
63
  url = "https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11"
64
- image = Image.open(requests.get(url, stream=True).raw)
65
-
66
 
67
- inputs = processor(text=text, images=[resize_with_aspect_ratio(raw_image)], return_tensors="pt")
68
  streamer = TextStreamer(processor.tokenizer, skip_prompt=True, skip_special_tokens=True)
69
 
70
  output = ov_model.generate(**inputs, do_sample=False, max_new_tokens=100, temperature=None, top_p=None, streamer=streamer)
 
48
  from optimum.intel.openvino import OVModelForVisualCausalLM
49
  from transformers import AutoProcessor, TextStreamer
50
 
51
+
52
  model_id = "OpenVINO/pixtral-12b-int4-ov"
53
 
54
  processor = AutoProcessor.from_pretrained(model_id)
 
60
  ]
61
  text = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
62
 
 
63
  url = "https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11"
64
+ raw_image = Image.open(requests.get(url, stream=True).raw)
 
65
 
66
+ inputs = processor(text=text, images=[raw_image], return_tensors="pt")
67
  streamer = TextStreamer(processor.tokenizer, skip_prompt=True, skip_special_tokens=True)
68
 
69
  output = ov_model.generate(**inputs, do_sample=False, max_new_tokens=100, temperature=None, top_p=None, streamer=streamer)