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:
|
||||
headers:
|
||||
content-length:
|
||||
- '1674'
|
||||
- '1931'
|
||||
content-type:
|
||||
- application/json
|
||||
parsed_body:
|
||||
|
|
@ -37,48 +37,37 @@ interactions:
|
|||
index: 0
|
||||
message:
|
||||
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**:
|
||||
- There is a preview space displaying an arrangement of colored blocks and shapes, likely representing parts of a document layout.
|
||||
- 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.
|
||||
1. **Field Labels:**
|
||||
- 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.
|
||||
|
||||
2. **Field Labels Box**:
|
||||
A section on the right side labeled "Field labels."
|
||||
The instructions read: “Identify the document elements using the buttons below.”
|
||||
2. **Document Display Area:**
|
||||
- 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.
|
||||
- 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**:
|
||||
- A list of field labels is given as a set of radio button selections, including:
|
||||
- Text
|
||||
- Picture
|
||||
- Formula
|
||||
- Code
|
||||
- Complex-form
|
||||
- Section-header
|
||||
- Page-footer
|
||||
- Page-header
|
||||
- Footnote
|
||||
- Table
|
||||
- List-item
|
||||
- Title
|
||||
3. **Tool Buttons/Bars:**
|
||||
- At the bottom left, there are interface buttons labeled "Skip", "Filter", and "Submit".
|
||||
- "Report Problem" is a button found at the bottom right of the interface.
|
||||
|
||||
4. **Navigation Elements**:
|
||||
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.
|
||||
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.
|
||||
role: assistant
|
||||
created: 1767616488
|
||||
id: chatcmpl-151
|
||||
created: 1768227488
|
||||
id: chatcmpl-657
|
||||
model: ministral-3
|
||||
object: chat.completion
|
||||
system_fingerprint: fp_ollama
|
||||
usage:
|
||||
completion_tokens: 290
|
||||
completion_tokens: 339
|
||||
prompt_tokens: 836
|
||||
total_tokens: 1126
|
||||
total_tokens: 1175
|
||||
status:
|
||||
code: 200
|
||||
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."""
|
||||
from PIL.Image import Image as PILImage
|
||||
|
||||
from haiku.rag.config import AppConfig
|
||||
|
||||
pdf_path = Path("tests/data/doclaynet.pdf")
|
||||
if not pdf_path.exists():
|
||||
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)
|
||||
assert isinstance(doc, Document)
|
||||
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.processing.converter = "docling-local"
|
||||
config.processing.chunker = "docling-local"
|
||||
config.processing.conversion_options.do_ocr = False
|
||||
config.search.context_radius = 5
|
||||
|
||||
async with HaikuRAG(temp_db_path, config=config, create=True) as client:
|
||||
|
|
|
|||
|
|
@ -407,6 +407,8 @@ class TestDoclingLocalConverter:
|
|||
if not pdf_path.exists():
|
||||
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
|
||||
config.processing.conversion_options.picture_description.enabled = True
|
||||
config.processing.conversion_options.picture_description.model.provider = (
|
||||
|
|
|
|||
Loading…
Reference in a new issue