dwani 0.1.17__tar.gz → 0.1.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dwani-0.1.17 → dwani-0.1.18}/PKG-INFO +1 -1
- {dwani-0.1.17 → dwani-0.1.18}/dwani/docs.py +7 -6
- {dwani-0.1.17 → dwani-0.1.18}/pyproject.toml +1 -1
- {dwani-0.1.17 → dwani-0.1.18}/LICENSE +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/MANIFEST.in +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/README.md +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/__init__.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/asr.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/audio.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/chat.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/client.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/exceptions.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/translate.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani/vision.py +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/dwani.egg-info/SOURCES.txt +0 -0
- {dwani-0.1.17 → dwani-0.1.18}/setup.cfg +0 -0
@@ -67,14 +67,15 @@ def document_ocr_all(client, file_path, model="gemma3"):
|
|
67
67
|
return resp.json()
|
68
68
|
|
69
69
|
|
70
|
-
def document_ocr_number(client, file_path, page_number
|
70
|
+
def document_ocr_number(client, file_path, page_number, model="gemma3"):
|
71
71
|
"""OCR a document (image/PDF) and return extracted text."""
|
72
72
|
logger.debug(f"Calling document_ocr: file_path={file_path}, model={model}")
|
73
73
|
validate_model(model)
|
74
74
|
|
75
75
|
data = {"model": model,
|
76
|
-
"page_number":
|
77
|
-
|
76
|
+
"page_number": page_number}
|
77
|
+
|
78
|
+
params = {"model": data["model"], "page_number": data["page_number"]}
|
78
79
|
with open(file_path, "rb") as f:
|
79
80
|
mime_type = "application/pdf" if file_path.lower().endswith('.pdf') else "image/png"
|
80
81
|
files = {"file": (file_path, f, mime_type)}
|
@@ -83,7 +84,7 @@ def document_ocr_number(client, file_path, page_number=1, model="gemma3"):
|
|
83
84
|
f"{client.api_base}/v1/extract-text",
|
84
85
|
headers=client._headers(),
|
85
86
|
files=files,
|
86
|
-
|
87
|
+
params=params,
|
87
88
|
timeout=60
|
88
89
|
)
|
89
90
|
resp.raise_for_status()
|
@@ -281,10 +282,10 @@ def doc_query_kannada(
|
|
281
282
|
|
282
283
|
class Documents:
|
283
284
|
@staticmethod
|
284
|
-
def run_ocr_number(file_path, page_number=
|
285
|
+
def run_ocr_number(file_path, page_number=2,model="gemma3"):
|
285
286
|
from .client import DwaniClient
|
286
287
|
client = DwaniClient()
|
287
|
-
return document_ocr_number(client, file_path, page_number
|
288
|
+
return document_ocr_number(client, file_path, page_number, model)
|
288
289
|
@staticmethod
|
289
290
|
def run_ocr_all(file_path, model="gemma3"):
|
290
291
|
from .client import DwaniClient
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
5
5
|
[project]
|
6
6
|
name = "dwani"
|
7
7
|
|
8
|
-
version = "0.1.
|
8
|
+
version = "0.1.18"
|
9
9
|
description = "Multimodal API for Indian + European languages (Chat, Vision, TTS, ASR, Translate, Docs)"
|
10
10
|
authors = [
|
11
11
|
{ name="sachin", email="python@dwani.ai" }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|