Update README.md
Browse files
README.md
CHANGED
|
@@ -76,6 +76,8 @@ uv pip install -U vllm \
|
|
| 76 |
--extra-index-url https://wheels.vllm.ai/nightly \
|
| 77 |
--prerelease=allow
|
| 78 |
|
|
|
|
|
|
|
| 79 |
uv pip install pypdfium2 pillow requests
|
| 80 |
```
|
| 81 |
|
|
@@ -105,8 +107,8 @@ pdf_data = requests.get(pdf_url).content
|
|
| 105 |
# Open PDF and convert first page to image
|
| 106 |
pdf = pdfium.PdfDocument(pdf_data)
|
| 107 |
page = pdf[0]
|
| 108 |
-
# Render at
|
| 109 |
-
pil_image = page.render(scale=
|
| 110 |
|
| 111 |
# Convert to base64
|
| 112 |
buffer = io.BytesIO()
|
|
@@ -123,7 +125,7 @@ payload = {
|
|
| 123 |
"image_url": {"url": f"data:image/png;base64,{image_base64}"}
|
| 124 |
}]
|
| 125 |
}],
|
| 126 |
-
"max_tokens":
|
| 127 |
"temperature": 0.2,
|
| 128 |
"top_p": 0.9,
|
| 129 |
}
|
|
|
|
| 76 |
--extra-index-url https://wheels.vllm.ai/nightly \
|
| 77 |
--prerelease=allow
|
| 78 |
|
| 79 |
+
# if this fails try adding triton-kernels package
|
| 80 |
+
'triton-kernels @ git+https://github.com/triton-lang/[email protected]#subdirectory=python/triton_kernels'
|
| 81 |
uv pip install pypdfium2 pillow requests
|
| 82 |
```
|
| 83 |
|
|
|
|
| 107 |
# Open PDF and convert first page to image
|
| 108 |
pdf = pdfium.PdfDocument(pdf_data)
|
| 109 |
page = pdf[0]
|
| 110 |
+
# Render at 200 DPI (scale factor = 200/72 ≈ 2.77)
|
| 111 |
+
pil_image = page.render(scale=2.77).to_pil()
|
| 112 |
|
| 113 |
# Convert to base64
|
| 114 |
buffer = io.BytesIO()
|
|
|
|
| 125 |
"image_url": {"url": f"data:image/png;base64,{image_base64}"}
|
| 126 |
}]
|
| 127 |
}],
|
| 128 |
+
"max_tokens": 4096,
|
| 129 |
"temperature": 0.2,
|
| 130 |
"top_p": 0.9,
|
| 131 |
}
|