Views
No views yet
pip install git+https://github.com/huggingface/transformers, or you might encounter the following error:KeyError: 'qwen2_vl'pip install qwen-vl-utils1min_pixels = 256 * 28 * 28
2max_pixels = 1280 * 28 * 28
3processor = AutoProcessor.from_pretrained(
4 "timtkddn/ko-ocr-qwen2-vl-awq", min_pixels=min_pixels, max_pixels=max_pixels
5)resized_height and resized_width. These values will be rounded to the nearest multiple of 28.1# min_pixels and max_pixels
2messages = [
3 {
4 "role": "user",
5 "content": [
6 {
7 "type": "image",
8 "image": "file:///path/to/your/image.jpg",
9 "resized_height": 280,
10 "resized_width": 420,
11 },
12 {"type": "text", "text": "Describe this image."},
13 ],
14 }
15]
16# resized_height and resized_width
17messages = [
18 {
19 "role": "user",
20 "content": [
21 {
22 "type": "image",
23 "image": "file:///path/to/your/image.jpg",
24 "min_pixels": 50176,
25 "max_pixels": 50176,
26 },
27 {"type": "text", "text": "Describe this image."},
28 ],
29 }
30]