synapse-sdk 1.0.0a47__py3-none-any.whl → 1.0.0a49__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.

Potentially problematic release.


This version of synapse-sdk might be problematic. Click here for more details.

@@ -66,8 +66,8 @@ class UpdateJob(BaseModel):
66
66
 
67
67
  status: Optional[JobStatus] = None
68
68
  progress_record: Optional[Dict] = None
69
- console_logs: Optional[Dict] = None
70
- result: Optional[Dict] = None
69
+ console_logs: Optional[Dict | list] = None
70
+ result: Optional[Dict | list] = None
71
71
 
72
72
  def model_dump(self, **kwargs):
73
73
  data = super().model_dump(**kwargs)
@@ -1,3 +1,4 @@
1
+ import json
1
2
  from abc import ABC, abstractmethod
2
3
  from datetime import datetime
3
4
  from typing import Annotated, Any, Literal
@@ -16,18 +17,12 @@ from synapse_sdk.utils.pydantic.validators import non_blank
16
17
  from synapse_sdk.utils.storage import get_pathlib
17
18
 
18
19
 
19
- class DataFileInfo(BaseModel):
20
- """Schema for data_file_info."""
21
-
22
- file_name: str
23
-
24
-
25
20
  class ExportRun(Run):
26
21
  class DataFileLog(BaseModel):
27
22
  """Data file log model."""
28
23
 
29
24
  target_id: int
30
- data_file_info: DataFileInfo
25
+ data_file_info: str | None
31
26
  status: ExportStatus
32
27
  error: str | None = None
33
28
  created: str
@@ -49,7 +44,7 @@ class ExportRun(Run):
49
44
  log_type,
50
45
  self.DataFileLog(
51
46
  target_id=target_id,
52
- data_file_info=data_file_info,
47
+ data_file_info=json.dumps(data_file_info),
53
48
  status=status.value,
54
49
  error=error,
55
50
  created=now,
@@ -22,11 +22,18 @@ class TuneRun(TrainRun):
22
22
  checkpoint_output = None
23
23
 
24
24
 
25
+ class SearchAlgo(BaseModel):
26
+ name: str
27
+ points_to_evaluate: Optional[dict] = None
28
+
29
+
25
30
  class TuneConfig(BaseModel):
26
31
  mode: Optional[str] = None
27
32
  metric: Optional[str] = None
28
33
  num_samples: int = 1
29
34
  max_concurrent_trials: Optional[int] = None
35
+ search_alg: Optional[SearchAlgo] = None
36
+ scheduler: Optional[str] = None
30
37
 
31
38
 
32
39
  class TuneParams(BaseModel):
@@ -170,7 +177,7 @@ class TuneAction(TrainAction):
170
177
  entrypoint = _tune
171
178
 
172
179
  trainable = tune.with_parameters(entrypoint, run=self.run, dataset=input_dataset, checkpoint=checkpoint)
173
- tune_config = self.params['tune_config']
180
+ tune_config = self.convert_tune_search_algo(self.params['tune_config'])
174
181
 
175
182
  hyperparameter = self.params['hyperparameter']
176
183
  param_space = self.convert_tune_params(hyperparameter)
@@ -230,6 +237,42 @@ class TuneAction(TrainAction):
230
237
  **params,
231
238
  })
232
239
 
240
+ @staticmethod
241
+ def convert_tune_search_algo(tune_config):
242
+ """
243
+ Convert YAML hyperparameter configuration to Ray Tune search algorithm and scheduler.
244
+
245
+ Args:
246
+ tune_config (dict): Hyperparameter configuration.
247
+
248
+ Returns:
249
+ dict: Ray Tune search algorithm and scheduler
250
+ """
251
+ from ray import tune
252
+
253
+ if tune_config['search_alg'] is None:
254
+ return tune_config
255
+
256
+ search_alg = tune_config['search_alg']['name']
257
+ metric = tune_config['metric']
258
+ mode = tune_config['mode']
259
+ points_to_evaluate = tune_config['search_alg'].get('points_to_evaluate', None)
260
+
261
+ if search_alg == 'AxSearch':
262
+ tune_config['search_alg'] = tune.search.ax.AxSearch(metric=metric, mode=mode)
263
+ elif search_alg == 'BayesOptSearch':
264
+ tune_config['search_alg'] = tune.search.bayesopt.BayesOptSearch(metric=metric, mode=mode)
265
+ elif search_alg == 'HyperOptSearch':
266
+ tune_config['search_alg'] = tune.search.hyperopt.HyperOptSearch(metric=metric, mode=mode)
267
+ elif search_alg == 'OptunaSearch':
268
+ tune_config['search_alg'] = tune.search.optuna.OptunaSearch(metric=metric, mode=mode)
269
+ elif search_alg == 'BasicVariantGenerator':
270
+ tune_config['search_alg'] = tune.search.basic_variant.BasicVariantGenerator(
271
+ points_to_evaluate=points_to_evaluate
272
+ )
273
+
274
+ return tune_config
275
+
233
276
  @staticmethod
234
277
  def convert_tune_params(param_list):
235
278
  """
@@ -243,19 +286,31 @@ class TuneAction(TrainAction):
243
286
  """
244
287
  from ray import tune
245
288
 
289
+ param_handlers = {
290
+ 'uniform': lambda p: tune.uniform(p['min'], p['max']),
291
+ 'quniform': lambda p: tune.quniform(p['min'], p['max']),
292
+ 'loguniform': lambda p: tune.loguniform(p['min'], p['max'], p['base']),
293
+ 'qloguniform': lambda p: tune.qloguniform(p['min'], p['max'], p['base']),
294
+ 'randn': lambda p: tune.randn(p['mean'], p['sd']),
295
+ 'qrandn': lambda p: tune.qrandn(p['mean'], p['sd']),
296
+ 'randint': lambda p: tune.randint(p['min'], p['max']),
297
+ 'qrandint': lambda p: tune.qrandint(p['min'], p['max']),
298
+ 'lograndint': lambda p: tune.lograndint(p['min'], p['max'], p['base']),
299
+ 'qlograndint': lambda p: tune.qlograndint(p['min'], p['max'], p['base']),
300
+ 'choice': lambda p: tune.choice(p['options']),
301
+ 'grid_search': lambda p: tune.grid_search(p['options']),
302
+ }
303
+
246
304
  param_space = {}
247
305
 
248
306
  for param in param_list:
249
307
  name = param['name']
250
308
  param_type = param['type']
251
309
 
252
- if param_type == 'loguniform':
253
- param_space[name] = tune.loguniform(param['min'], param['max'])
254
- elif param_type == 'choice':
255
- param_space[name] = tune.choice(param['options'])
256
- elif param_type == 'randint':
257
- param_space[name] = tune.randint(param['min'], param['max'])
258
- # Add more type handlers as needed
310
+ if param_type in param_handlers:
311
+ param_space[name] = param_handlers[param_type](param)
312
+ else:
313
+ raise ValueError(f'Unknown parameter type: {param_type}')
259
314
 
260
315
  return param_space
261
316
 
@@ -5,7 +5,7 @@ readme: README.md
5
5
  description: This is plugin_name plugin
6
6
  category: neural_net
7
7
  tasks:
8
- - object_detection
8
+ - image.object_detection
9
9
  data_type: image
10
10
  package_manager: uv
11
11
  actions:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a47
3
+ Version: 1.0.0a49
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -22,6 +22,8 @@ Requires-Dist: fsspec[gcs,s3,sftp]
22
22
  Provides-Extra: all
23
23
  Requires-Dist: ray[all]; extra == "all"
24
24
  Requires-Dist: python-nmap; extra == "all"
25
+ Requires-Dist: hyperopt; extra == "all"
26
+ Requires-Dist: bayesian-optimization==1.4.3; extra == "all"
25
27
  Dynamic: license-file
26
28
 
27
29
  This is the SDK to develop synapse plugins
@@ -35,7 +35,7 @@ synapse_sdk/clients/backend/dataset.py,sha256=11R5LuTva9jgXatxQAlKy7UEJmwIWzTsLV
35
35
  synapse_sdk/clients/backend/hitl.py,sha256=na2mSXFud92p4zUEuagcDWk2klxO7xn-e86cm0VZEvs,709
36
36
  synapse_sdk/clients/backend/integration.py,sha256=9LjkYcBpi7aog-MODSDS4RlmYahypu65qxBj-AcY7xc,2683
37
37
  synapse_sdk/clients/backend/ml.py,sha256=JoPH9Ly2E3HJ7S5mdGLtcGq7ruQVVrYfWArogwZLlms,1193
38
- synapse_sdk/clients/backend/models.py,sha256=XYG6SmEnSvKRE1UD8M_3GiN56gWTGSOW5oMex3-mTtE,1947
38
+ synapse_sdk/clients/backend/models.py,sha256=s5d9sGGQ0Elj0HOGC1TuwE-eBkY1aTfJPl6ls11bNCk,1961
39
39
  synapse_sdk/clients/ray/__init__.py,sha256=9ZSPXVVxlJ8Wp8ku7l021ENtPjVrGgQDgqifkkVAXgM,187
40
40
  synapse_sdk/clients/ray/core.py,sha256=a4wyCocAma2HAm-BHlbZnoVbpfdR-Aad2FM0z6vPFvw,731
41
41
  synapse_sdk/clients/ray/serve.py,sha256=rbCpXZYWf0oP8XJ9faa9QFNPYU7h8dltIG8xn9ZconY,907
@@ -61,7 +61,7 @@ synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py,sh
61
61
  synapse_sdk/plugins/categories/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  synapse_sdk/plugins/categories/export/enums.py,sha256=gtyngvQ1DKkos9iKGcbecwTVQQ6sDwbrBPSGPNb5Am0,127
63
63
  synapse_sdk/plugins/categories/export/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- synapse_sdk/plugins/categories/export/actions/export.py,sha256=sVga8cgprKFpZB-RCiZghCGQcBnr7Y58-jig9vPMbrc,9990
64
+ synapse_sdk/plugins/categories/export/actions/export.py,sha256=xqPB_MufeMP3riaKCbGVFGukV8RdXcg6-zUrkw4t1-A,9922
65
65
  synapse_sdk/plugins/categories/export/templates/config.yaml,sha256=N7YmnFROb3s3M35SA9nmabyzoSb5O2t2TRPicwFNN2o,56
66
66
  synapse_sdk/plugins/categories/export/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  synapse_sdk/plugins/categories/export/templates/plugin/export.py,sha256=UzPOYvH2rwUlTUpMgcbn7mBsenf3hmWytE-eD_cB_9A,5202
@@ -72,10 +72,10 @@ synapse_sdk/plugins/categories/neural_net/actions/gradio.py,sha256=jBkonh0JHRIKF
72
72
  synapse_sdk/plugins/categories/neural_net/actions/inference.py,sha256=0a655ELqNVjPFZTJDiw4EUdcMCPGveUEKyoYqpwMFBU,1019
73
73
  synapse_sdk/plugins/categories/neural_net/actions/test.py,sha256=JY25eg-Fo6WbgtMkGoo_qNqoaZkp3AQNEypJmeGzEog,320
74
74
  synapse_sdk/plugins/categories/neural_net/actions/train.py,sha256=kve6iTCg2kUeavMQTR2JFuoYDu-QWZFFlB58ZICQtdM,5406
75
- synapse_sdk/plugins/categories/neural_net/actions/tune.py,sha256=XJczlLDF8FOJXA-7TXNZa3npWhMsT0wGqQwYW3w5TDo,9475
75
+ synapse_sdk/plugins/categories/neural_net/actions/tune.py,sha256=wDJMZ1vPdALsY9T9D9kDe9klCnqcfpcl0e2q7kef5XA,11855
76
76
  synapse_sdk/plugins/categories/neural_net/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
77
  synapse_sdk/plugins/categories/neural_net/base/inference.py,sha256=R5DASI6-5vzsjDOYxqeGGMBjnav5qHF4hNJT8zNUR3I,1097
78
- synapse_sdk/plugins/categories/neural_net/templates/config.yaml,sha256=uZVuXjIfsd_pTaSKptHeHn1TN2FIiLrvvpkClToc6po,596
78
+ synapse_sdk/plugins/categories/neural_net/templates/config.yaml,sha256=ZDw6X2GLfwIywpgEXFwFkUOQwSMDGvBTwc_qW7bw8H4,602
79
79
  synapse_sdk/plugins/categories/neural_net/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
80
  synapse_sdk/plugins/categories/neural_net/templates/plugin/inference.py,sha256=InfqKWJYi6sqiUnfPKHC5KYGhxckDaWZNQ202u-uVP4,366
81
81
  synapse_sdk/plugins/categories/neural_net/templates/plugin/test.py,sha256=kYyk7l4UtcDUAH4nkdVUGrHHHjxI4p1U13HSLnmGPyE,53
@@ -134,9 +134,9 @@ synapse_sdk/utils/storage/providers/__init__.py,sha256=x7RGwZryT2FpVxS7fGWryRVpq
134
134
  synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_ncGITZrL0u5wEA,363
135
135
  synapse_sdk/utils/storage/providers/s3.py,sha256=W94rQvhGRXti3R4mYP7gmU5pcyCQpGFIBLvxxqLVdRM,2231
136
136
  synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
137
- synapse_sdk-1.0.0a47.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
138
- synapse_sdk-1.0.0a47.dist-info/METADATA,sha256=m85ag15c0Y0vLrK6u7J6FVg8DgP9ew_bfXr-9ERl-jA,1203
139
- synapse_sdk-1.0.0a47.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
140
- synapse_sdk-1.0.0a47.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
141
- synapse_sdk-1.0.0a47.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
142
- synapse_sdk-1.0.0a47.dist-info/RECORD,,
137
+ synapse_sdk-1.0.0a49.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
138
+ synapse_sdk-1.0.0a49.dist-info/METADATA,sha256=0TLX25pKAV_0955eqiN1100FtQTgEst7h797J8vDR2A,1303
139
+ synapse_sdk-1.0.0a49.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
140
+ synapse_sdk-1.0.0a49.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
141
+ synapse_sdk-1.0.0a49.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
142
+ synapse_sdk-1.0.0a49.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5