Disable ocr in tests previously marked as integration
This commit is contained in:
parent
52363639a6
commit
ce326d80ff
6 changed files with 44 additions and 73 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -28,7 +28,7 @@ interactions:
|
||||||
response:
|
response:
|
||||||
headers:
|
headers:
|
||||||
content-length:
|
content-length:
|
||||||
- '1674'
|
- '1931'
|
||||||
content-type:
|
content-type:
|
||||||
- application/json
|
- application/json
|
||||||
parsed_body:
|
parsed_body:
|
||||||
|
|
@ -37,48 +37,37 @@ interactions:
|
||||||
index: 0
|
index: 0
|
||||||
message:
|
message:
|
||||||
content: |-
|
content: |-
|
||||||
This is a screenshot of a software interface for labeling or tagging elements within a document.
|
This is a screenshot of a software interface used for labeling or annotating elements within a document or image.
|
||||||
|
|
||||||
Here’s a concise description for better understanding:
|
The screenshot depicts a tool designated for identifying and classifying document elements using field labels listed on the right side. Here's a concise breakdown of the main elements:
|
||||||
|
|
||||||
1. **Main Area**:
|
1. **Field Labels:**
|
||||||
- There is a preview space displaying an arrangement of colored blocks and shapes, likely representing parts of a document layout.
|
- The side panel (at the right) displays a list of category options for types of document elements. These include: Text, Picture, Formula, Code, Complex-form (highlighted), Section Header, Page Header, Page Footer, Footnote, Table, List Item, and Title. One category, "Complex-form," is currently highlighted.
|
||||||
- The colored areas include horizontal bars (various colors: green, red, blue, yellow, pink), graphical charts, and some abstract text or layout boxes. There is also a pie chart and a pair of bar-like shapes.
|
|
||||||
|
|
||||||
2. **Field Labels Box**:
|
2. **Document Display Area:**
|
||||||
A section on the right side labeled "Field labels."
|
- In the center and on the left side of the image, there are various colored sections resembling different parts of a document format like spreadsheets, charts, forms, graphics, and a color-coded bar-like structure.
|
||||||
The instructions read: “Identify the document elements using the buttons below.”
|
- Each section has a cursor or blue anchor point (with an "X"), which you likely use to select and annotate an element.
|
||||||
|
- Specific color-coded elements include:
|
||||||
|
- Horizontal and vertical color bars
|
||||||
|
- Tables and form grid
|
||||||
|
- Pie chart and bar chart graphics
|
||||||
|
- Sections of a form (in red and grey)
|
||||||
|
|
||||||
3. **Label Options**:
|
3. **Tool Buttons/Bars:**
|
||||||
- A list of field labels is given as a set of radio button selections, including:
|
- At the bottom left, there are interface buttons labeled "Skip", "Filter", and "Submit".
|
||||||
- Text
|
- "Report Problem" is a button found at the bottom right of the interface.
|
||||||
- Picture
|
|
||||||
- Formula
|
|
||||||
- Code
|
|
||||||
- Complex-form
|
|
||||||
- Section-header
|
|
||||||
- Page-footer
|
|
||||||
- Page-header
|
|
||||||
- Footnote
|
|
||||||
- Table
|
|
||||||
- List-item
|
|
||||||
- Title
|
|
||||||
|
|
||||||
4. **Navigation Elements**:
|
The visible text primarily appears in this list of category options, highlighted labels, and button texts. The specific content within the graphic segments is not readable text but visual representations.
|
||||||
There are three buttons at the bottom left: "Skip," "Filter," and "Submit."
|
|
||||||
There is additionally a highlighted "Report problem" button at the bottom right, in blue.
|
|
||||||
|
|
||||||
The elements depicted visually serve to assist in identifying and tagging different parts of the document interface for further processing or analysis.
|
|
||||||
role: assistant
|
role: assistant
|
||||||
created: 1767616488
|
created: 1768227488
|
||||||
id: chatcmpl-151
|
id: chatcmpl-657
|
||||||
model: ministral-3
|
model: ministral-3
|
||||||
object: chat.completion
|
object: chat.completion
|
||||||
system_fingerprint: fp_ollama
|
system_fingerprint: fp_ollama
|
||||||
usage:
|
usage:
|
||||||
completion_tokens: 290
|
completion_tokens: 339
|
||||||
prompt_tokens: 836
|
prompt_tokens: 836
|
||||||
total_tokens: 1126
|
total_tokens: 1175
|
||||||
status:
|
status:
|
||||||
code: 200
|
code: 200
|
||||||
message: OK
|
message: OK
|
||||||
|
|
|
||||||
|
|
@ -1098,11 +1098,16 @@ async def test_client_visualize_chunk_with_pdf(temp_db_path):
|
||||||
"""Test visualize_chunk returns images with bounding boxes for PDF documents."""
|
"""Test visualize_chunk returns images with bounding boxes for PDF documents."""
|
||||||
from PIL.Image import Image as PILImage
|
from PIL.Image import Image as PILImage
|
||||||
|
|
||||||
|
from haiku.rag.config import AppConfig
|
||||||
|
|
||||||
pdf_path = Path("tests/data/doclaynet.pdf")
|
pdf_path = Path("tests/data/doclaynet.pdf")
|
||||||
if not pdf_path.exists():
|
if not pdf_path.exists():
|
||||||
pytest.skip("doclaynet.pdf not found")
|
pytest.skip("doclaynet.pdf not found")
|
||||||
|
|
||||||
async with HaikuRAG(temp_db_path, create=True) as client:
|
config = AppConfig()
|
||||||
|
config.processing.conversion_options.do_ocr = False
|
||||||
|
|
||||||
|
async with HaikuRAG(temp_db_path, config=config, create=True) as client:
|
||||||
doc = await client.create_document_from_source(pdf_path)
|
doc = await client.create_document_from_source(pdf_path)
|
||||||
assert isinstance(doc, Document)
|
assert isinstance(doc, Document)
|
||||||
assert doc.id is not None
|
assert doc.id is not None
|
||||||
|
|
|
||||||
|
|
@ -761,6 +761,7 @@ async def test_expand_context_no_base64_images_docling_local(temp_db_path):
|
||||||
config = AppConfig()
|
config = AppConfig()
|
||||||
config.processing.converter = "docling-local"
|
config.processing.converter = "docling-local"
|
||||||
config.processing.chunker = "docling-local"
|
config.processing.chunker = "docling-local"
|
||||||
|
config.processing.conversion_options.do_ocr = False
|
||||||
config.search.context_radius = 5
|
config.search.context_radius = 5
|
||||||
|
|
||||||
async with HaikuRAG(temp_db_path, config=config, create=True) as client:
|
async with HaikuRAG(temp_db_path, config=config, create=True) as client:
|
||||||
|
|
|
||||||
|
|
@ -407,6 +407,8 @@ class TestDoclingLocalConverter:
|
||||||
if not pdf_path.exists():
|
if not pdf_path.exists():
|
||||||
pytest.skip("doclaynet.pdf not found")
|
pytest.skip("doclaynet.pdf not found")
|
||||||
|
|
||||||
|
# Disable OCR (not needed for native PDF, avoids model downloads)
|
||||||
|
config.processing.conversion_options.do_ocr = False
|
||||||
# Enable picture description with Ollama
|
# Enable picture description with Ollama
|
||||||
config.processing.conversion_options.picture_description.enabled = True
|
config.processing.conversion_options.picture_description.enabled = True
|
||||||
config.processing.conversion_options.picture_description.model.provider = (
|
config.processing.conversion_options.picture_description.model.provider = (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue