BabelDOC 0.2.7__tar.gz → 0.2.8__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.
Files changed (91) hide show
  1. {babeldoc-0.2.7 → babeldoc-0.2.8}/PKG-INFO +10 -2
  2. {babeldoc-0.2.7 → babeldoc-0.2.8}/README.md +6 -0
  3. babeldoc-0.2.8/babeldoc/__init__.py +1 -0
  4. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/const.py +1 -1
  5. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/il_translator.py +1 -1
  6. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/translator/translator.py +34 -0
  7. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/docvision/doclayout.py +11 -2
  8. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/main.py +4 -1
  9. {babeldoc-0.2.7 → babeldoc-0.2.8}/pyproject.toml +9 -3
  10. {babeldoc-0.2.7 → babeldoc-0.2.8}/uv.lock +11 -11
  11. babeldoc-0.2.7/babeldoc/__init__.py +0 -1
  12. {babeldoc-0.2.7 → babeldoc-0.2.8}/.cursorignore +0 -0
  13. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
  14. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
  15. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/dependabot.yml +0 -0
  16. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/labels.yml +0 -0
  17. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/release-drafter.yml +0 -0
  18. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/workflows/codeql.yml +0 -0
  19. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/workflows/docs.yml +0 -0
  20. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/workflows/labeler.yml +0 -0
  21. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/workflows/publish-to-pypi.yml +0 -0
  22. {babeldoc-0.2.7 → babeldoc-0.2.8}/.github/workflows/test.yml +0 -0
  23. {babeldoc-0.2.7 → babeldoc-0.2.8}/.gitignore +0 -0
  24. {babeldoc-0.2.7 → babeldoc-0.2.8}/.pre-commit-config.yaml +0 -0
  25. {babeldoc-0.2.7 → babeldoc-0.2.8}/LICENSE +0 -0
  26. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/assets/assets.py +0 -0
  27. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/assets/embedding_assets_metadata.py +0 -0
  28. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/asynchronize/__init__.py +0 -0
  29. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/converter.py +0 -0
  30. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/__init__.py +0 -0
  31. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py +0 -0
  32. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/backend/__init__.py +0 -0
  33. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/backend/pdf_creater.py +0 -0
  34. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/frontend/__init__.py +0 -0
  35. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/frontend/il_creater.py +0 -0
  36. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/il_version_1.py +0 -0
  37. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/il_version_1.rnc +0 -0
  38. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/il_version_1.rng +0 -0
  39. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/il_version_1.xsd +0 -0
  40. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/__init__.py +0 -0
  41. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/add_debug_information.py +0 -0
  42. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/detect_scanned_file.py +0 -0
  43. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/il_translator_llm_only.py +1 -1
  44. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/layout_parser.py +0 -0
  45. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/paragraph_finder.py +0 -0
  46. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/remove_descent.py +0 -0
  47. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/styles_and_formulas.py +0 -0
  48. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/midend/typesetting.py +0 -0
  49. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/translator/__init__.py +0 -0
  50. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/translator/cache.py +0 -0
  51. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/utils/fontmap.py +0 -0
  52. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/utils/layout_helper.py +0 -0
  53. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/utils/style_helper.py +0 -0
  54. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/document_il/xml_converter.py +0 -0
  55. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/docvision/README.md +0 -0
  56. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/docvision/__init__.py +0 -0
  57. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/docvision/rpc_doclayout.py +0 -0
  58. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/high_level.py +0 -0
  59. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/pdfinterp.py +0 -0
  60. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/progress_monitor.py +0 -0
  61. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/tools/generate_font_metadata.py +0 -0
  62. {babeldoc-0.2.7 → babeldoc-0.2.8}/babeldoc/translation_config.py +0 -0
  63. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/CODE_OF_CONDUCT.md +0 -0
  64. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/CONTRIBUTING.md +0 -0
  65. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/CONTRIBUTOR_REWARD.md +0 -0
  66. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
  67. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
  68. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
  69. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
  70. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
  71. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/README.md +0 -0
  72. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
  73. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
  74. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/README.md +0 -0
  75. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/deploy.sh +0 -0
  76. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-banner.png +0 -0
  77. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
  78. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
  79. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
  80. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
  81. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-big-logo.png +0 -0
  82. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-contributor_reward_example.png +0 -0
  83. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-preview.gif +0 -0
  84. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
  85. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
  86. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/images/babeldoc-small-logo.png +0 -0
  87. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/index.md +0 -0
  88. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/intro-to-pdf-object.md +0 -0
  89. {babeldoc-0.2.7 → babeldoc-0.2.8}/docs/requirements.txt +0 -0
  90. {babeldoc-0.2.7 → babeldoc-0.2.8}/mkdocs.yml +0 -0
  91. {babeldoc-0.2.7 → babeldoc-0.2.8}/tests/test_translation_config.py +0 -0
@@ -1,9 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: BabelDOC
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Yet Another Document Translator
5
5
  Project-URL: Homepage, https://github.com/funstory-ai/BabelDOC
6
6
  Project-URL: Issues, https://github.com/funstory-ai/BabelDOC/issues
7
+ Author-email: awwaawwa <aw@funstory.ai>
8
+ Maintainer-email: awwaawwa <aw@funstory.ai>
7
9
  License-Expression: AGPL-3.0
8
10
  License-File: LICENSE
9
11
  Keywords: PDF
@@ -20,7 +22,7 @@ Requires-Dist: numpy>=2.0.2
20
22
  Requires-Dist: onnx>=1.17.0
21
23
  Requires-Dist: onnxruntime>=1.16.1
22
24
  Requires-Dist: openai>=1.59.3
23
- Requires-Dist: opencv-python>=4.10.0.84
25
+ Requires-Dist: opencv-python-headless>=4.10.0.84
24
26
  Requires-Dist: orjson>=3.10.14
25
27
  Requires-Dist: pdfminer-six>=20240706
26
28
  Requires-Dist: peewee>=3.17.8
@@ -293,6 +295,12 @@ report-interval = 0.5
293
295
 
294
296
  ## Python API
295
297
 
298
+ > [!TIP]
299
+ >
300
+ > 1. Before pdf2zh 2.0 is released, you can temporarily use BabelDOC's Python API. However, after pdf2zh 2.0 is released, please directly use pdf2zh's Python API.
301
+ >
302
+ > 2. This project's Python API does not guarantee any compatibility. However, the Python API from pdf2zh will guarantee a certain level of compatibility.
303
+
296
304
  You can refer to the example in [main.py](https://github.com/funstory-ai/yadt/blob/main/babeldoc/main.py) to use BabelDOC's Python API.
297
305
 
298
306
  Please note:
@@ -255,6 +255,12 @@ report-interval = 0.5
255
255
 
256
256
  ## Python API
257
257
 
258
+ > [!TIP]
259
+ >
260
+ > 1. Before pdf2zh 2.0 is released, you can temporarily use BabelDOC's Python API. However, after pdf2zh 2.0 is released, please directly use pdf2zh's Python API.
261
+ >
262
+ > 2. This project's Python API does not guarantee any compatibility. However, the Python API from pdf2zh will guarantee a certain level of compatibility.
263
+
258
264
  You can refer to the example in [main.py](https://github.com/funstory-ai/yadt/blob/main/babeldoc/main.py) to use BabelDOC's Python API.
259
265
 
260
266
  Please note:
@@ -0,0 +1 @@
1
+ __version__ = "0.2.8"
@@ -3,7 +3,7 @@ import shutil
3
3
  import subprocess
4
4
  from pathlib import Path
5
5
 
6
- __version__ = "0.2.7"
6
+ __version__ = "0.2.8"
7
7
 
8
8
  CACHE_FOLDER = Path.home() / ".cache" / "babeldoc"
9
9
 
@@ -603,7 +603,7 @@ class ILTranslator:
603
603
  )
604
604
  except Exception as e:
605
605
  logger.exception(
606
- f"Error translating paragraph. Paragraph: {paragraph}. Error: {e}. ",
606
+ f"Error translating paragraph. Paragraph: {paragraph.debug_id} ({paragraph.unicode}). Error: {e}. ",
607
607
  )
608
608
  # ignore error and continue
609
609
  return
@@ -62,6 +62,31 @@ def set_translate_rate_limiter(max_qps):
62
62
  _translate_rate_limiter.set_max_qps(max_qps)
63
63
 
64
64
 
65
+ class AtomicInteger:
66
+ def __init__(self, value=0):
67
+ self._value = int(value)
68
+ self._lock = threading.Lock()
69
+
70
+ def inc(self, d=1):
71
+ with self._lock:
72
+ self._value += int(d)
73
+ return self._value
74
+
75
+ def dec(self, d=1):
76
+ return self.inc(-d)
77
+
78
+ @property
79
+ def value(self):
80
+ with self._lock:
81
+ return self._value
82
+
83
+ @value.setter
84
+ def value(self, v):
85
+ with self._lock:
86
+ self._value = int(v)
87
+ return self._value
88
+
89
+
65
90
  class BaseTranslator(ABC):
66
91
  # Due to cache limitations, name should be within 20 characters.
67
92
  # cache.py: translate_engine = CharField(max_length=20)
@@ -195,6 +220,9 @@ class OpenAITranslator(BaseTranslator):
195
220
  self.model = model
196
221
  self.add_cache_impact_parameters("model", self.model)
197
222
  self.add_cache_impact_parameters("prompt", self.prompt(""))
223
+ self.token_count = AtomicInteger()
224
+ self.prompt_token_count = AtomicInteger()
225
+ self.completion_token_count = AtomicInteger()
198
226
 
199
227
  @retry(
200
228
  retry=retry_if_exception_type(openai.RateLimitError),
@@ -211,6 +239,9 @@ class OpenAITranslator(BaseTranslator):
211
239
  **self.options,
212
240
  messages=self.prompt(text),
213
241
  )
242
+ self.token_count.inc(response.usage.total_tokens)
243
+ self.prompt_token_count.inc(response.usage.prompt_tokens)
244
+ self.completion_token_count.inc(response.usage.completion_tokens)
214
245
  return response.choices[0].message.content.strip()
215
246
 
216
247
  def prompt(self, text):
@@ -248,6 +279,9 @@ class OpenAITranslator(BaseTranslator):
248
279
  },
249
280
  ],
250
281
  )
282
+ self.token_count.inc(response.usage.total_tokens)
283
+ self.prompt_token_count.inc(response.usage.prompt_tokens)
284
+ self.completion_token_count.inc(response.usage.completion_tokens)
251
285
  return response.choices[0].message.content.strip()
252
286
 
253
287
  def get_formular_placeholder(self, placeholder_id: int):
@@ -6,8 +6,17 @@ from collections.abc import Generator
6
6
 
7
7
  import cv2
8
8
  import numpy as np
9
- import onnx
10
- import onnxruntime
9
+
10
+ try:
11
+ import onnx
12
+ import onnxruntime
13
+ except ImportError as e:
14
+ if "DLL load failed" in str(e):
15
+ raise OSError(
16
+ "Microsoft Visual C++ Redistributable is not installed. "
17
+ "Download it at https://aka.ms/vs/17/release/vc_redist.x64.exe"
18
+ ) from e
19
+ raise
11
20
  import pymupdf
12
21
 
13
22
  import babeldoc.document_il.il_version_1
@@ -22,7 +22,7 @@ from babeldoc.translation_config import TranslationConfig
22
22
  from babeldoc.translation_config import WatermarkOutputMode
23
23
 
24
24
  logger = logging.getLogger(__name__)
25
- __version__ = "0.2.7"
25
+ __version__ = "0.2.8"
26
26
 
27
27
 
28
28
  def create_parser():
@@ -353,6 +353,9 @@ async def main():
353
353
  result = event["translate_result"]
354
354
  logger.info(str(result))
355
355
  break
356
+ logger.info(f"Total tokens: {translator.token_count.value}")
357
+ logger.info(f"Prompt tokens: {translator.prompt_token_count.value}")
358
+ logger.info(f"Completion tokens: {translator.completion_token_count.value}")
356
359
 
357
360
 
358
361
  def create_progress_handler(translation_config: TranslationConfig):
@@ -1,10 +1,16 @@
1
1
  [project]
2
2
  name = "BabelDOC"
3
- version = "0.2.7"
3
+ version = "0.2.8"
4
4
  description = "Yet Another Document Translator"
5
5
  license = "AGPL-3.0"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.10,<3.13"
8
+ authors = [
9
+ { name = "awwaawwa", email = "aw@funstory.ai" }
10
+ ]
11
+ maintainers = [
12
+ { name = "awwaawwa", email = "aw@funstory.ai" }
13
+ ]
8
14
  classifiers = [
9
15
  "Programming Language :: Python :: 3",
10
16
  "Operating System :: OS Independent",
@@ -19,7 +25,6 @@ dependencies = [
19
25
  "onnx>=1.17.0",
20
26
  "onnxruntime>=1.16.1",
21
27
  "openai>=1.59.3",
22
- "opencv-python>=4.10.0.84",
23
28
  "orjson>=3.10.14",
24
29
  "pdfminer-six>=20240706",
25
30
  "peewee>=3.17.8",
@@ -35,6 +40,7 @@ dependencies = [
35
40
  "freetype-py>=2.5.1",
36
41
  "tiktoken>=0.9.0",
37
42
  "python-levenshtein>=0.27.1",
43
+ "opencv-python-headless>=4.10.0.84",
38
44
  ]
39
45
 
40
46
  [project.urls]
@@ -136,7 +142,7 @@ pythonpath = [".", "src"]
136
142
  testpaths = ["tests"]
137
143
 
138
144
  [bumpver]
139
- current_version = "0.2.7"
145
+ current_version = "0.2.8"
140
146
  version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
141
147
 
142
148
  [bumpver.file_patterns]
@@ -48,7 +48,7 @@ wheels = [
48
48
 
49
49
  [[package]]
50
50
  name = "babeldoc"
51
- version = "0.2.7"
51
+ version = "0.2.8"
52
52
  source = { editable = "." }
53
53
  dependencies = [
54
54
  { name = "bitstring" },
@@ -61,7 +61,7 @@ dependencies = [
61
61
  { name = "onnx" },
62
62
  { name = "onnxruntime" },
63
63
  { name = "openai" },
64
- { name = "opencv-python" },
64
+ { name = "opencv-python-headless" },
65
65
  { name = "orjson" },
66
66
  { name = "pdfminer-six" },
67
67
  { name = "peewee" },
@@ -104,7 +104,7 @@ requires-dist = [
104
104
  { name = "onnx", specifier = ">=1.17.0" },
105
105
  { name = "onnxruntime", specifier = ">=1.16.1" },
106
106
  { name = "openai", specifier = ">=1.59.3" },
107
- { name = "opencv-python", specifier = ">=4.10.0.84" },
107
+ { name = "opencv-python-headless", specifier = ">=4.10.0.84" },
108
108
  { name = "orjson", specifier = ">=3.10.14" },
109
109
  { name = "pdfminer-six", specifier = ">=20240706" },
110
110
  { name = "peewee", specifier = ">=3.17.8" },
@@ -1368,20 +1368,20 @@ wheels = [
1368
1368
  ]
1369
1369
 
1370
1370
  [[package]]
1371
- name = "opencv-python"
1371
+ name = "opencv-python-headless"
1372
1372
  version = "4.11.0.86"
1373
1373
  source = { registry = "https://pypi.org/simple" }
1374
1374
  dependencies = [
1375
1375
  { name = "numpy" },
1376
1376
  ]
1377
- sdist = { url = "https://files.pythonhosted.org/packages/17/06/68c27a523103dad5837dc5b87e71285280c4f098c60e4fe8a8db6486ab09/opencv-python-4.11.0.86.tar.gz", hash = "sha256:03d60ccae62304860d232272e4a4fda93c39d595780cb40b161b310244b736a4", size = 95171956 }
1377
+ sdist = { url = "https://files.pythonhosted.org/packages/36/2f/5b2b3ba52c864848885ba988f24b7f105052f68da9ab0e693cc7c25b0b30/opencv-python-headless-4.11.0.86.tar.gz", hash = "sha256:996eb282ca4b43ec6a3972414de0e2331f5d9cda2b41091a49739c19fb843798", size = 95177929 }
1378
1378
  wheels = [
1379
- { url = "https://files.pythonhosted.org/packages/05/4d/53b30a2a3ac1f75f65a59eb29cf2ee7207ce64867db47036ad61743d5a23/opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:432f67c223f1dc2824f5e73cdfcd9db0efc8710647d4e813012195dc9122a52a", size = 37326322 },
1380
- { url = "https://files.pythonhosted.org/packages/3b/84/0a67490741867eacdfa37bc18df96e08a9d579583b419010d7f3da8ff503/opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:9d05ef13d23fe97f575153558653e2d6e87103995d54e6a35db3f282fe1f9c66", size = 56723197 },
1381
- { url = "https://files.pythonhosted.org/packages/f3/bd/29c126788da65c1fb2b5fb621b7fed0ed5f9122aa22a0868c5e2c15c6d23/opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b92ae2c8852208817e6776ba1ea0d6b1e0a1b5431e971a2a0ddd2a8cc398202", size = 42230439 },
1382
- { url = "https://files.pythonhosted.org/packages/2c/8b/90eb44a40476fa0e71e05a0283947cfd74a5d36121a11d926ad6f3193cc4/opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b02611523803495003bd87362db3e1d2a0454a6a63025dc6658a9830570aa0d", size = 62986597 },
1383
- { url = "https://files.pythonhosted.org/packages/fb/d7/1d5941a9dde095468b288d989ff6539dd69cd429dbf1b9e839013d21b6f0/opencv_python-4.11.0.86-cp37-abi3-win32.whl", hash = "sha256:810549cb2a4aedaa84ad9a1c92fbfdfc14090e2749cedf2c1589ad8359aa169b", size = 29384337 },
1384
- { url = "https://files.pythonhosted.org/packages/a4/7d/f1c30a92854540bf789e9cd5dde7ef49bbe63f855b85a2e6b3db8135c591/opencv_python-4.11.0.86-cp37-abi3-win_amd64.whl", hash = "sha256:085ad9b77c18853ea66283e98affefe2de8cc4c1f43eda4c100cf9b2721142ec", size = 39488044 },
1379
+ { url = "https://files.pythonhosted.org/packages/dc/53/2c50afa0b1e05ecdb4603818e85f7d174e683d874ef63a6abe3ac92220c8/opencv_python_headless-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:48128188ade4a7e517237c8e1e11a9cdf5c282761473383e77beb875bb1e61ca", size = 37326460 },
1380
+ { url = "https://files.pythonhosted.org/packages/3b/43/68555327df94bb9b59a1fd645f63fafb0762515344d2046698762fc19d58/opencv_python_headless-4.11.0.86-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:a66c1b286a9de872c343ee7c3553b084244299714ebb50fbdcd76f07ebbe6c81", size = 56723330 },
1381
+ { url = "https://files.pythonhosted.org/packages/45/be/1438ce43ebe65317344a87e4b150865c5585f4c0db880a34cdae5ac46881/opencv_python_headless-4.11.0.86-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6efabcaa9df731f29e5ea9051776715b1bdd1845d7c9530065c7951d2a2899eb", size = 29487060 },
1382
+ { url = "https://files.pythonhosted.org/packages/dd/5c/c139a7876099916879609372bfa513b7f1257f7f1a908b0bdc1c2328241b/opencv_python_headless-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e0a27c19dd1f40ddff94976cfe43066fbbe9dfbb2ec1907d66c19caef42a57b", size = 49969856 },
1383
+ { url = "https://files.pythonhosted.org/packages/95/dd/ed1191c9dc91abcc9f752b499b7928aacabf10567bb2c2535944d848af18/opencv_python_headless-4.11.0.86-cp37-abi3-win32.whl", hash = "sha256:f447d8acbb0b6f2808da71fddd29c1cdd448d2bc98f72d9bb78a7a898fc9621b", size = 29324425 },
1384
+ { url = "https://files.pythonhosted.org/packages/86/8a/69176a64335aed183529207ba8bc3d329c2999d852b4f3818027203f50e6/opencv_python_headless-4.11.0.86-cp37-abi3-win_amd64.whl", hash = "sha256:6c304df9caa7a6a5710b91709dd4786bf20a74d57672b3c31f7033cc638174ca", size = 39402386 },
1385
1385
  ]
1386
1386
 
1387
1387
  [[package]]
@@ -1 +0,0 @@
1
- __version__ = "0.2.7"
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -328,9 +328,9 @@ class ILTranslatorLLMOnly:
328
328
  translate_input,
329
329
  translated_text,
330
330
  )
331
+ should_fallback = False
331
332
  if pbar:
332
333
  pbar.advance(1)
333
- should_fallback = False
334
334
  except Exception as e:
335
335
  logger.exception(f"Error translating paragraph. Error: {e}.")
336
336
  # Ignore error and continue
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes