sparrow-parse 0.3.11__py3-none-any.whl → 0.3.12__py3-none-any.whl

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.
sparrow_parse/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.3.11'
1
+ __version__ = '0.3.12'
@@ -55,33 +55,33 @@ if __name__ == "__main__":
55
55
 
56
56
  extractor = VLLMExtractor()
57
57
 
58
- # export HF_TOKEN="hf_"
59
- config = {
60
- "method": "mlx", # Could be 'huggingface', 'mlx' or 'local_gpu'
61
- "model_name": "mlx-community/Qwen2-VL-72B-Instruct-4bit",
62
- # "hf_space": "katanaml/sparrow-qwen2-vl-7b",
63
- # "hf_token": os.getenv('HF_TOKEN'),
64
- # Additional fields for local GPU inference
65
- # "device": "cuda", "model_path": "model.pth"
66
- }
67
-
68
- # Use the factory to get the correct instance
69
- factory = InferenceFactory(config)
70
- model_inference_instance = factory.get_inference_instance()
71
-
72
- input_data = [
73
- {
74
- "file_path": "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/oracle_10k_2014_q1_small.pdf",
75
- "text_input": "retrieve table, description, latest_amount, previous_amount. return response in JSON format, by strictly following this JSON schema: {\"table\": [{\"description\": \"str\", \"latest_amount\": 0, \"previous_amount\": 0}]}"
76
- }
77
- ]
78
-
79
- # Now you can run inference without knowing which implementation is used
80
- results_array, num_pages = extractor.run_inference(model_inference_instance, input_data, generic_query=False,
81
- debug_dir=None,
82
- debug=True,
83
- mode=None)
84
-
85
- for i, result in enumerate(results_array):
86
- print(f"Result for page {i + 1}:", result)
87
- print(f"Number of pages: {num_pages}")
58
+ # # export HF_TOKEN="hf_"
59
+ # config = {
60
+ # "method": "mlx", # Could be 'huggingface', 'mlx' or 'local_gpu'
61
+ # "model_name": "mlx-community/Qwen2-VL-72B-Instruct-4bit",
62
+ # # "hf_space": "katanaml/sparrow-qwen2-vl-7b",
63
+ # # "hf_token": os.getenv('HF_TOKEN'),
64
+ # # Additional fields for local GPU inference
65
+ # # "device": "cuda", "model_path": "model.pth"
66
+ # }
67
+ #
68
+ # # Use the factory to get the correct instance
69
+ # factory = InferenceFactory(config)
70
+ # model_inference_instance = factory.get_inference_instance()
71
+ #
72
+ # input_data = [
73
+ # {
74
+ # "file_path": "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/oracle_10k_2014_q1_small.pdf",
75
+ # "text_input": "retrieve table, description, latest_amount, previous_amount. return response in JSON format, by strictly following this JSON schema: {\"table\": [{\"description\": \"str\", \"latest_amount\": 0, \"previous_amount\": 0}]}"
76
+ # }
77
+ # ]
78
+ #
79
+ # # Now you can run inference without knowing which implementation is used
80
+ # results_array, num_pages = extractor.run_inference(model_inference_instance, input_data, generic_query=False,
81
+ # debug_dir=None,
82
+ # debug=True,
83
+ # mode=None)
84
+ #
85
+ # for i, result in enumerate(results_array):
86
+ # print(f"Result for page {i + 1}:", result)
87
+ # print(f"Number of pages: {num_pages}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparrow-parse
3
- Version: 0.3.11
3
+ Version: 0.3.12
4
4
  Summary: Sparrow Parse is a Python package (part of Sparrow) for parsing and extracting information from documents.
5
5
  Home-page: https://github.com/katanaml/sparrow/tree/main/sparrow-data/parse
6
6
  Author: Andrej Baranovskij
@@ -24,7 +24,7 @@ Requires-Dist: pypdf==4.3.0
24
24
  Requires-Dist: easyocr==1.7.1
25
25
  Requires-Dist: gradio-client
26
26
  Requires-Dist: pdf2image
27
- Requires-Dist: mlx-vlm==0.1.3; sys_platform == "darwin" and platform_machine == "arm64"
27
+ Requires-Dist: mlx-vlm==0.1.4; sys_platform == "darwin" and platform_machine == "arm64"
28
28
 
29
29
  # Sparrow Parse
30
30
 
@@ -1,7 +1,7 @@
1
- sparrow_parse/__init__.py,sha256=ffGYSp8ZNa0Q4_Q7ecO1MiMLkWV8z2pOxdetmy6GsVI,22
1
+ sparrow_parse/__init__.py,sha256=_ZihGlMI7X-0KVVWL_iXdUXrQS9gun7MiVTXSd1Xs4o,22
2
2
  sparrow_parse/__main__.py,sha256=Xs1bpJV0n08KWOoQE34FBYn6EBXZA9HIYJKrE4ZdG78,153
3
3
  sparrow_parse/extractors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- sparrow_parse/extractors/vllm_extractor.py,sha256=UDKoh5KDdGqNeJJCVdt044yo2SlvWBqWVzhHknSMTlU,3576
4
+ sparrow_parse/extractors/vllm_extractor.py,sha256=E2-Zpfssu2MVkmVjHpjBh9WK3rJ7ywHhMjJX3xZB_H8,3648
5
5
  sparrow_parse/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  sparrow_parse/helpers/pdf_optimizer.py,sha256=GIqQYWtixFeZGCRFXL0lQfQByapCDuQzzRHAkzcPwLE,3302
7
7
  sparrow_parse/processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,8 +12,8 @@ sparrow_parse/vllm/inference_base.py,sha256=4mwGoAY63MB4cHZpV0czTkJWEzimmiTzqqzK
12
12
  sparrow_parse/vllm/inference_factory.py,sha256=FTM65O-dW2WZchHOrNN7_Q3-FlVoAc65iSptuuUuClM,1166
13
13
  sparrow_parse/vllm/local_gpu_inference.py,sha256=aHoJTejb5xrXjWDIGu5RBQWEyRCOBCB04sMvO2Wyvg8,628
14
14
  sparrow_parse/vllm/mlx_inference.py,sha256=xR40qwjIR0HvrN8x58oOq6F4r1hEANRB-9kcokUQHHU,4748
15
- sparrow_parse-0.3.11.dist-info/METADATA,sha256=1WHTqOZ-IBrlYHA6z2gJV4lIBunPN0uynpWZ2ikQ3g0,6351
16
- sparrow_parse-0.3.11.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
17
- sparrow_parse-0.3.11.dist-info/entry_points.txt,sha256=8CrvTVTTcz1YuZ8aRCYNOH15ZOAaYLlcbYX3t28HwJY,54
18
- sparrow_parse-0.3.11.dist-info/top_level.txt,sha256=n6b-WtT91zKLyCPZTP7wvne8v_yvIahcsz-4sX8I0rY,14
19
- sparrow_parse-0.3.11.dist-info/RECORD,,
15
+ sparrow_parse-0.3.12.dist-info/METADATA,sha256=tgTHQSWokNEc0TOry7EpunttLgYXYd6GEx6bzedb25s,6351
16
+ sparrow_parse-0.3.12.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
17
+ sparrow_parse-0.3.12.dist-info/entry_points.txt,sha256=8CrvTVTTcz1YuZ8aRCYNOH15ZOAaYLlcbYX3t28HwJY,54
18
+ sparrow_parse-0.3.12.dist-info/top_level.txt,sha256=n6b-WtT91zKLyCPZTP7wvne8v_yvIahcsz-4sX8I0rY,14
19
+ sparrow_parse-0.3.12.dist-info/RECORD,,