GameSentenceMiner 2.15.2__py3-none-any.whl → 2.15.3__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.
@@ -1014,7 +1014,6 @@ class OneOCR:
1014
1014
  res = ocr_resp['text']
1015
1015
 
1016
1016
  if multiple_crop_coords:
1017
- logger.info(f"Getting multiple crop coords for {len(filtered_lines)} lines")
1018
1017
  for line in filtered_lines:
1019
1018
  crop_coords_list.append(
1020
1019
  (line['bounding_rect']['x1'] - 5, line['bounding_rect']['y1'] - 5,
@@ -1434,13 +1433,10 @@ class localLLMOCR:
1434
1433
  self.keep_warm = config.get('keep_warm', True)
1435
1434
  self.custom_prompt = config.get('prompt', None)
1436
1435
  self.available = True
1437
- if any(x in self.api_url for x in ['localhost', '127.0.0.1']):
1438
- if not self.check_connection(self.api_url):
1439
- logger.warning('Local LLM OCR API is not reachable')
1440
- return
1441
1436
  self.client = openai.OpenAI(
1442
1437
  base_url=self.api_url.replace('/v1/chat/completions', '/v1'),
1443
- api_key=self.api_key
1438
+ api_key=self.api_key,
1439
+ timeout=3
1444
1440
  )
1445
1441
  if self.client.models.retrieve(self.model):
1446
1442
  self.model = self.model
@@ -1450,24 +1446,6 @@ class localLLMOCR:
1450
1446
  self.keep_llm_hot_thread.start()
1451
1447
  except Exception as e:
1452
1448
  logger.warning(f'Error initializing Local LLM OCR, Local LLM OCR will not work!')
1453
-
1454
- def check_connection(self, url, port=None):
1455
- import http.client
1456
- conn = http.client.HTTPConnection(url, port or 1234, timeout=0.1)
1457
- try:
1458
- conn.request("GET", "/v1/models")
1459
- response = conn.getresponse()
1460
- if response.status == 200:
1461
- logger.info('Local LLM OCR API is reachable')
1462
- return True
1463
- else:
1464
- logger.warning('Local LLM OCR API is not reachable')
1465
- return False
1466
- except Exception as e:
1467
- logger.warning(f'Error connecting to Local LLM OCR API: {e}')
1468
- return False
1469
- finally:
1470
- conn.close()
1471
1449
 
1472
1450
  def keep_llm_warm(self):
1473
1451
  def ocr_blank_black_image():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.15.2
3
+ Version: 2.15.3
4
4
  Summary: A tool for mining sentences from games. Update: Overlay?
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -28,7 +28,7 @@ GameSentenceMiner/owocr/owocr/__init__.py,sha256=87hfN5u_PbL_onLfMACbc0F5j4KyIK9
28
28
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
29
29
  GameSentenceMiner/owocr/owocr/config.py,sha256=qM7kISHdUhuygGXOxmgU6Ef2nwBShrZtdqu4InDCViE,8103
30
30
  GameSentenceMiner/owocr/owocr/lens_betterproto.py,sha256=oNoISsPilVVRBBPVDtb4-roJtAhp8ZAuFTci3TGXtMc,39141
31
- GameSentenceMiner/owocr/owocr/ocr.py,sha256=rJKmB8xtSVrayq8XcZ4JKBULyPKDqfJDGKgLjICbUX8,71021
31
+ GameSentenceMiner/owocr/owocr/ocr.py,sha256=JXUboda00-1GYzYYDTiYcPaeWKKwvMdQ-q_CHVB7h10,70014
32
32
  GameSentenceMiner/owocr/owocr/run.py,sha256=xbBpyFCVfITZDztsRLT8_sX6BGf1o5LxOPxE9zUWfQc,79975
33
33
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
34
34
  GameSentenceMiner/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -72,9 +72,9 @@ GameSentenceMiner/web/templates/index.html,sha256=LqXZx7-NE42pXSpHNZ3To680rD-vt9
72
72
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
73
73
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
74
74
  GameSentenceMiner/wip/__init___.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- gamesentenceminer-2.15.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
- gamesentenceminer-2.15.2.dist-info/METADATA,sha256=G5LgyYGod4vrUBzQESiCd7p8CQwBybDYTVXy7Fkv_M8,7317
77
- gamesentenceminer-2.15.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
- gamesentenceminer-2.15.2.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
79
- gamesentenceminer-2.15.2.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
80
- gamesentenceminer-2.15.2.dist-info/RECORD,,
75
+ gamesentenceminer-2.15.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
+ gamesentenceminer-2.15.3.dist-info/METADATA,sha256=4zXzdtgHkL9Tv-ZNqDJr5mZ9ra6O8UpACup5X0zOy7M,7317
77
+ gamesentenceminer-2.15.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ gamesentenceminer-2.15.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
79
+ gamesentenceminer-2.15.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
80
+ gamesentenceminer-2.15.3.dist-info/RECORD,,