nucliadb 6.3.7.post4079__py3-none-any.whl → 6.3.7.post4081__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.
@@ -45,6 +45,7 @@ from nucliadb.train.generators.sentence_classifier import (
45
45
  from nucliadb.train.generators.token_classifier import (
46
46
  token_classification_batch_generator,
47
47
  )
48
+ from nucliadb.train.settings import settings
48
49
  from nucliadb.train.types import TrainBatch
49
50
  from nucliadb.train.utils import get_shard_manager
50
51
  from nucliadb_protos.dataset_pb2 import TaskType, TrainSet
@@ -88,7 +89,7 @@ async def generate_train_data(kbid: str, shard: str, trainset: TrainSet):
88
89
 
89
90
  # This cache size is an arbitrary number, once we have a metric in place and
90
91
  # we analyze memory consumption, we can adjust it with more knoweldge
91
- with resource_cache(size=20):
92
+ with resource_cache(size=settings.resource_cache_size):
92
93
  async for item in batch_generator:
93
94
  payload = item.SerializeToString()
94
95
  yield len(payload).to_bytes(4, byteorder="big", signed=False)
@@ -42,12 +42,12 @@ async def lifespan(app: FastAPI):
42
42
  await start_shard_manager()
43
43
  await start_train_grpc(SERVICE_NAME)
44
44
  await start_audit_utility(SERVICE_NAME)
45
-
46
- async with inject_app_context(app):
47
- yield
48
-
49
- await stop_audit_utility()
50
- await stop_train_grpc()
51
- await stop_shard_manager()
52
- await stop_nidx_utility()
53
- await clean_telemetry(SERVICE_NAME)
45
+ try:
46
+ async with inject_app_context(app):
47
+ yield
48
+ finally:
49
+ await stop_audit_utility()
50
+ await stop_train_grpc()
51
+ await stop_shard_manager()
52
+ await stop_nidx_utility()
53
+ await clean_telemetry(SERVICE_NAME)
@@ -33,5 +33,7 @@ class Settings(DriverSettings):
33
33
 
34
34
  internal_search_api: str = "http://search.nuclia.svc.cluster.local:8030/api/v1/kb/{kbid}/search"
35
35
 
36
+ resource_cache_size: int = 2
37
+
36
38
 
37
39
  settings = Settings()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.3.7.post4079
3
+ Version: 6.3.7.post4081
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License: AGPL
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: <4,>=3.9
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: nucliadb-telemetry[all]>=6.3.7.post4079
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.7.post4079
25
- Requires-Dist: nucliadb-protos>=6.3.7.post4079
26
- Requires-Dist: nucliadb-models>=6.3.7.post4079
27
- Requires-Dist: nidx-protos>=6.3.7.post4079
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.3.7.post4081
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.7.post4081
25
+ Requires-Dist: nucliadb-protos>=6.3.7.post4081
26
+ Requires-Dist: nucliadb-models>=6.3.7.post4081
27
+ Requires-Dist: nidx-protos>=6.3.7.post4081
28
28
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
29
29
  Requires-Dist: nuclia-models>=0.24.2
30
30
  Requires-Dist: uvicorn[standard]
@@ -297,15 +297,15 @@ nucliadb/tests/config.py,sha256=JN_Jhgj-fwM9_8IeO9pwxr6C1PiwRDrXxm67Y38rU30,2080
297
297
  nucliadb/tests/vectors.py,sha256=CcNKx-E8LPpyvRyljbmb-Tn_wST9Juw2CBoogWrKiTk,62843
298
298
  nucliadb/train/__init__.py,sha256=NVwe5yULoHXb80itIJT8YJYEz2xbiOPQ7_OMys6XJw8,1301
299
299
  nucliadb/train/app.py,sha256=TiRttTvekLuZdIvi46E4HyuumDTkR4G4Luqq3fEdjes,2824
300
- nucliadb/train/generator.py,sha256=w2Jv605Zv4o1F9SQc1NlpuVHiJ3vyaCufv2DKTDlXb4,4158
301
- nucliadb/train/lifecycle.py,sha256=a96KuAVZ0sf9TVVW6v6szVXn2eGBaboszwnv_HdWiZk,1820
300
+ nucliadb/train/generator.py,sha256=B3bdkH-IWiqib-ALpU_g8wFe0xOmdE0kEPxvki28yEU,4229
301
+ nucliadb/train/lifecycle.py,sha256=VwGboBw0buqkJWYmrmr95IEGjk0ZxkvPAh-jLmGP-MM,1868
302
302
  nucliadb/train/models.py,sha256=BmgmMjDsu_1Ih5JDAqo6whhume90q0ASJcDP9dkMQm8,1198
303
303
  nucliadb/train/nodes.py,sha256=HROQMRw2g5sJTnuBagh3B0id3iWonRJ68tg3skOme9k,5748
304
304
  nucliadb/train/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
305
305
  nucliadb/train/resource.py,sha256=3qQ_9Zdt5JAbtD-wpmt7OeDGRNKS-fQdKAuIQfznZm0,16219
306
306
  nucliadb/train/run.py,sha256=evz6CKVfJOzkbHMoaYz2mTMlKjJnNOb1O8zBBWMpeBw,1400
307
307
  nucliadb/train/servicer.py,sha256=scbmq8FriKsJGkOcoZB2Fg_IyIExn9Ux4W30mGDlkJQ,5728
308
- nucliadb/train/settings.py,sha256=rrLtgdBmuthtIObLuZUaeuo4VBGU2PJRazquQbtPBeI,1383
308
+ nucliadb/train/settings.py,sha256=8_-XCO_nrE98cMJpe0fYkXeF2bkWKff1VX-2qdwcsjs,1417
309
309
  nucliadb/train/types.py,sha256=xyVYy8kHipAWoDb7Pn7dCYQ_efHPzDW_3AXg5M-aV28,1519
310
310
  nucliadb/train/upload.py,sha256=fTjH1KEL-0ogf3LV0T6ODO0QdPGwdZShSUtFUCAcUlA,3256
311
311
  nucliadb/train/uploader.py,sha256=xdLGz1ToDue9Q_M8A-_KYkO-V6fWKYOZQ6IGM4FuwWA,6424
@@ -365,8 +365,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
365
365
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
366
366
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
367
367
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
368
- nucliadb-6.3.7.post4079.dist-info/METADATA,sha256=WP6AMoJHWMGwWeqYxHCKJbhd7mTgzJDQD6f4fCrdp6w,4226
369
- nucliadb-6.3.7.post4079.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
370
- nucliadb-6.3.7.post4079.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
371
- nucliadb-6.3.7.post4079.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
372
- nucliadb-6.3.7.post4079.dist-info/RECORD,,
368
+ nucliadb-6.3.7.post4081.dist-info/METADATA,sha256=f3AUmeJD7DbHyV7NNxca-lrGNS78aRoy8HbnafTwXu4,4226
369
+ nucliadb-6.3.7.post4081.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
370
+ nucliadb-6.3.7.post4081.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
371
+ nucliadb-6.3.7.post4081.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
372
+ nucliadb-6.3.7.post4081.dist-info/RECORD,,