sparrow-parse 0.4.5__py3-none-any.whl → 0.4.6__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.4.5'
1
+ __version__ = '0.4.6'
@@ -23,3 +23,9 @@ class InferenceFactory:
23
23
  # model = torch.load('model.pth')
24
24
  # return model
25
25
  raise NotImplementedError("Model loading logic not implemented")
26
+
27
+
28
+ def unload_inference_instance(self, instance):
29
+ if instance and hasattr(instance, "unload_model"):
30
+ instance.unload_model()
31
+ print(f"Inference instance of type {type(instance).__name__} has been unloaded.")
@@ -25,12 +25,6 @@ class MLXInference(ModelInference):
25
25
  print(f"MLXInference initialized with model: {model_name}")
26
26
 
27
27
 
28
- def __del__(self):
29
- """
30
- Destructor to clean up resources when the object is deleted.
31
- """
32
- self.unload_model()
33
-
34
28
  def unload_model(self):
35
29
  """
36
30
  Unload the model and release resources.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparrow-parse
3
- Version: 0.4.5
3
+ Version: 0.4.6
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
@@ -1,4 +1,4 @@
1
- sparrow_parse/__init__.py,sha256=aYJpblaKx7C4NugypZ2lZHBzsGsZoG5sUbcsPwgoi9s,21
1
+ sparrow_parse/__init__.py,sha256=IIRkY9z46sq_aFXyT8WySWX9GdnZHB1GyedV8VfB_lA,21
2
2
  sparrow_parse/__main__.py,sha256=Xs1bpJV0n08KWOoQE34FBYn6EBXZA9HIYJKrE4ZdG78,153
3
3
  sparrow_parse/extractors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  sparrow_parse/extractors/vllm_extractor.py,sha256=G4kQh0GoZ4V4TdyeDwZWFkOG15MQCQMvSf2UbFQDWeI,7746
@@ -9,11 +9,11 @@ sparrow_parse/processors/table_structure_processor.py,sha256=PQHHFdQUuTin3Mm2USu
9
9
  sparrow_parse/vllm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  sparrow_parse/vllm/huggingface_inference.py,sha256=EJnG6PesGKMc_0qGPN8ufE6pSnhAgFu0XjCbaLCNVyM,1980
11
11
  sparrow_parse/vllm/inference_base.py,sha256=4mwGoAY63MB4cHZpV0czTkJWEzimmiTzqqzKmLNzgjw,820
12
- sparrow_parse/vllm/inference_factory.py,sha256=FTM65O-dW2WZchHOrNN7_Q3-FlVoAc65iSptuuUuClM,1166
12
+ sparrow_parse/vllm/inference_factory.py,sha256=J5_sPIL6YlkttaGeTc6_6t4004klQxESeeLLhXHvyZg,1407
13
13
  sparrow_parse/vllm/local_gpu_inference.py,sha256=aHoJTejb5xrXjWDIGu5RBQWEyRCOBCB04sMvO2Wyvg8,628
14
- sparrow_parse/vllm/mlx_inference.py,sha256=0LP6tDeaID7Rtarcs_ffmK6I77e2xv5tjs4xyt0qxLo,6100
15
- sparrow_parse-0.4.5.dist-info/METADATA,sha256=HbGmqb5Kq7BKVNUi5wE_w69LZMAYQXI34cpRN6pdWAs,6432
16
- sparrow_parse-0.4.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
17
- sparrow_parse-0.4.5.dist-info/entry_points.txt,sha256=8CrvTVTTcz1YuZ8aRCYNOH15ZOAaYLlcbYX3t28HwJY,54
18
- sparrow_parse-0.4.5.dist-info/top_level.txt,sha256=n6b-WtT91zKLyCPZTP7wvne8v_yvIahcsz-4sX8I0rY,14
19
- sparrow_parse-0.4.5.dist-info/RECORD,,
14
+ sparrow_parse/vllm/mlx_inference.py,sha256=NNBJ_eQZTzJ6X05wUfJhGLJjm1ANMB5BxpW7GMR4S3g,5955
15
+ sparrow_parse-0.4.6.dist-info/METADATA,sha256=YiIuculsNFZVH2YKtSGTRpOMPpc6B2DhH0sbW99onBM,6432
16
+ sparrow_parse-0.4.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
17
+ sparrow_parse-0.4.6.dist-info/entry_points.txt,sha256=8CrvTVTTcz1YuZ8aRCYNOH15ZOAaYLlcbYX3t28HwJY,54
18
+ sparrow_parse-0.4.6.dist-info/top_level.txt,sha256=n6b-WtT91zKLyCPZTP7wvne8v_yvIahcsz-4sX8I0rY,14
19
+ sparrow_parse-0.4.6.dist-info/RECORD,,