snowflake-ml-python 1.7.5__py3-none-any.whl → 1.8.0__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.
Files changed (61) hide show
  1. snowflake/cortex/_complete.py +58 -3
  2. snowflake/ml/_internal/file_utils.py +18 -4
  3. snowflake/ml/_internal/platform_capabilities.py +3 -0
  4. snowflake/ml/_internal/telemetry.py +4 -0
  5. snowflake/ml/fileset/fileset.py +0 -1
  6. snowflake/ml/jobs/_utils/constants.py +24 -0
  7. snowflake/ml/jobs/_utils/payload_utils.py +94 -20
  8. snowflake/ml/jobs/_utils/spec_utils.py +73 -31
  9. snowflake/ml/jobs/decorators.py +3 -0
  10. snowflake/ml/jobs/manager.py +5 -0
  11. snowflake/ml/model/_client/model/model_version_impl.py +1 -1
  12. snowflake/ml/model/_client/ops/model_ops.py +107 -14
  13. snowflake/ml/model/_client/ops/service_ops.py +1 -1
  14. snowflake/ml/model/_client/service/model_deployment_spec.py +7 -3
  15. snowflake/ml/model/_client/sql/model_version.py +58 -0
  16. snowflake/ml/model/_client/sql/service.py +8 -2
  17. snowflake/ml/model/_model_composer/model_composer.py +50 -3
  18. snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +4 -0
  19. snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +2 -1
  20. snowflake/ml/model/_model_composer/model_method/model_method.py +0 -1
  21. snowflake/ml/model/_packager/model_env/model_env.py +4 -1
  22. snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +28 -24
  23. snowflake/ml/model/_packager/model_handlers/keras.py +1 -5
  24. snowflake/ml/model/_packager/model_handlers/pytorch.py +50 -20
  25. snowflake/ml/model/_packager/model_handlers/sklearn.py +1 -4
  26. snowflake/ml/model/_packager/model_handlers/snowmlmodel.py +1 -2
  27. snowflake/ml/model/_packager/model_handlers/tensorflow.py +46 -26
  28. snowflake/ml/model/_packager/model_handlers/torchscript.py +49 -20
  29. snowflake/ml/model/_packager/model_handlers/xgboost.py +2 -2
  30. snowflake/ml/model/_packager/model_handlers_migrator/pytorch_migrator_2023_12_01.py +20 -0
  31. snowflake/ml/model/_packager/model_handlers_migrator/tensorflow_migrator_2025_01_01.py +19 -0
  32. snowflake/ml/model/_packager/model_handlers_migrator/torchscript_migrator_2023_12_01.py +20 -0
  33. snowflake/ml/model/_packager/model_meta/_packaging_requirements.py +0 -1
  34. snowflake/ml/model/_packager/model_meta/model_meta.py +5 -1
  35. snowflake/ml/model/_packager/model_meta/model_meta_schema.py +13 -0
  36. snowflake/ml/model/_packager/model_packager.py +3 -5
  37. snowflake/ml/model/_packager/model_runtime/_snowml_inference_alternative_requirements.py +1 -2
  38. snowflake/ml/model/_packager/model_runtime/model_runtime.py +4 -0
  39. snowflake/ml/model/_signatures/builtins_handler.py +20 -9
  40. snowflake/ml/model/_signatures/core.py +52 -31
  41. snowflake/ml/model/_signatures/dmatrix_handler.py +98 -0
  42. snowflake/ml/model/_signatures/numpy_handler.py +9 -17
  43. snowflake/ml/model/_signatures/pandas_handler.py +19 -30
  44. snowflake/ml/model/_signatures/pytorch_handler.py +57 -41
  45. snowflake/ml/model/_signatures/snowpark_handler.py +0 -12
  46. snowflake/ml/model/_signatures/tensorflow_handler.py +61 -67
  47. snowflake/ml/model/_signatures/utils.py +120 -8
  48. snowflake/ml/model/custom_model.py +13 -4
  49. snowflake/ml/model/model_signature.py +31 -13
  50. snowflake/ml/model/type_hints.py +13 -2
  51. snowflake/ml/modeling/metrics/ranking.py +3 -0
  52. snowflake/ml/modeling/metrics/regression.py +3 -0
  53. snowflake/ml/modeling/preprocessing/k_bins_discretizer.py +1 -1
  54. snowflake/ml/registry/_manager/model_manager.py +55 -7
  55. snowflake/ml/registry/registry.py +18 -0
  56. snowflake/ml/version.py +1 -1
  57. {snowflake_ml_python-1.7.5.dist-info → snowflake_ml_python-1.8.0.dist-info}/METADATA +287 -11
  58. {snowflake_ml_python-1.7.5.dist-info → snowflake_ml_python-1.8.0.dist-info}/RECORD +61 -57
  59. {snowflake_ml_python-1.7.5.dist-info → snowflake_ml_python-1.8.0.dist-info}/WHEEL +1 -1
  60. {snowflake_ml_python-1.7.5.dist-info → snowflake_ml_python-1.8.0.dist-info/licenses}/LICENSE.txt +0 -0
  61. {snowflake_ml_python-1.7.5.dist-info → snowflake_ml_python-1.8.0.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
4
4
  import pandas as pd
5
5
  from absl.logging import logging
6
6
 
7
- from snowflake.ml._internal import telemetry
7
+ from snowflake.ml._internal import platform_capabilities, telemetry
8
8
  from snowflake.ml._internal.exceptions import error_codes, exceptions
9
9
  from snowflake.ml._internal.human_readable_id import hrid_generator
10
10
  from snowflake.ml._internal.utils import sql_identifier
@@ -13,7 +13,7 @@ from snowflake.ml.model._client.model import model_impl, model_version_impl
13
13
  from snowflake.ml.model._client.ops import metadata_ops, model_ops, service_ops
14
14
  from snowflake.ml.model._model_composer import model_composer
15
15
  from snowflake.ml.model._packager.model_meta import model_meta
16
- from snowflake.snowpark import session
16
+ from snowflake.snowpark import exceptions as snowpark_exceptions, session
17
17
 
18
18
  logger = logging.getLogger(__name__)
19
19
 
@@ -46,6 +46,7 @@ class ModelManager:
46
46
  metrics: Optional[Dict[str, Any]] = None,
47
47
  conda_dependencies: Optional[List[str]] = None,
48
48
  pip_requirements: Optional[List[str]] = None,
49
+ artifact_repository_map: Optional[Dict[str, str]] = None,
49
50
  target_platforms: Optional[List[model_types.SupportedTargetPlatformType]] = None,
50
51
  python_version: Optional[str] = None,
51
52
  signatures: Optional[Dict[str, model_signature.ModelSignature]] = None,
@@ -127,6 +128,7 @@ class ModelManager:
127
128
  metrics=metrics,
128
129
  conda_dependencies=conda_dependencies,
129
130
  pip_requirements=pip_requirements,
131
+ artifact_repository_map=artifact_repository_map,
130
132
  target_platforms=target_platforms,
131
133
  python_version=python_version,
132
134
  signatures=signatures,
@@ -149,6 +151,7 @@ class ModelManager:
149
151
  metrics: Optional[Dict[str, Any]] = None,
150
152
  conda_dependencies: Optional[List[str]] = None,
151
153
  pip_requirements: Optional[List[str]] = None,
154
+ artifact_repository_map: Optional[Dict[str, str]] = None,
152
155
  target_platforms: Optional[List[model_types.SupportedTargetPlatformType]] = None,
153
156
  python_version: Optional[str] = None,
154
157
  signatures: Optional[Dict[str, model_signature.ModelSignature]] = None,
@@ -163,11 +166,42 @@ class ModelManager:
163
166
  database_name_id, schema_name_id, model_name_id = sql_identifier.parse_fully_qualified_name(model_name)
164
167
  version_name_id = sql_identifier.SqlIdentifier(version_name)
165
168
 
166
- stage_path = self._model_ops.prepare_model_stage_path(
167
- database_name=database_name_id,
168
- schema_name=schema_name_id,
169
- statement_params=statement_params,
170
- )
169
+ use_live_commit = platform_capabilities.PlatformCapabilities.get_instance().is_live_commit_enabled()
170
+ if use_live_commit:
171
+ logger.info("Using live commit model version")
172
+ else:
173
+ logger.info("Using non-live commit model version")
174
+
175
+ if use_live_commit:
176
+ # This step creates the live model version, and the files can be written directly to the stage
177
+ # after this.
178
+ try:
179
+ self._model_ops.add_or_create_live_version(
180
+ database_name=database_name_id,
181
+ schema_name=schema_name_id,
182
+ model_name=model_name_id,
183
+ version_name=version_name_id,
184
+ statement_params=statement_params,
185
+ )
186
+ except (AssertionError, snowpark_exceptions.SnowparkSQLException) as e:
187
+ logger.info(f"Failed to create live model version: {e}, falling back to regular model version creation")
188
+ use_live_commit = False
189
+
190
+ if use_live_commit:
191
+ # using model version's stage path to write files directly to the stage
192
+ stage_path = self._model_ops.get_model_version_stage_path(
193
+ database_name=database_name_id,
194
+ schema_name=schema_name_id,
195
+ model_name=model_name_id,
196
+ version_name=version_name_id,
197
+ )
198
+ else:
199
+ # using a temp path to write files and then upload to the model version's stage
200
+ stage_path = self._model_ops.prepare_model_temp_stage_path(
201
+ database_name=database_name_id,
202
+ schema_name=schema_name_id,
203
+ statement_params=statement_params,
204
+ )
171
205
 
172
206
  platforms = None
173
207
  # User specified target platforms are defaulted to None and will not show up in the generated manifest.
@@ -175,6 +209,18 @@ class ModelManager:
175
209
  # Convert any string target platforms to TargetPlatform objects
176
210
  platforms = [model_types.TargetPlatform(platform) for platform in target_platforms]
177
211
 
212
+ if artifact_repository_map:
213
+ for channel, artifact_repository_name in artifact_repository_map.items():
214
+ db_id, schema_id, repo_id = sql_identifier.parse_fully_qualified_name(artifact_repository_name)
215
+
216
+ artifact_repository_map[channel] = sql_identifier.get_fully_qualified_name(
217
+ db_id,
218
+ schema_id,
219
+ repo_id,
220
+ self._database_name,
221
+ self._schema_name,
222
+ )
223
+
178
224
  logger.info("Start packaging and uploading your model. It might take some time based on the size of the model.")
179
225
 
180
226
  mc = model_composer.ModelComposer(
@@ -187,6 +233,7 @@ class ModelManager:
187
233
  sample_input_data=sample_input_data,
188
234
  conda_dependencies=conda_dependencies,
189
235
  pip_requirements=pip_requirements,
236
+ artifact_repository_map=artifact_repository_map,
190
237
  target_platforms=platforms,
191
238
  python_version=python_version,
192
239
  user_files=user_files,
@@ -211,6 +258,7 @@ class ModelManager:
211
258
  model_name=model_name_id,
212
259
  version_name=version_name_id,
213
260
  statement_params=statement_params,
261
+ use_live_commit=use_live_commit,
214
262
  )
215
263
 
216
264
  mv = model_version_impl.ModelVersion._ref(
@@ -108,6 +108,7 @@ class Registry:
108
108
  metrics: Optional[Dict[str, Any]] = None,
109
109
  conda_dependencies: Optional[List[str]] = None,
110
110
  pip_requirements: Optional[List[str]] = None,
111
+ artifact_repository_map: Optional[Dict[str, str]] = None,
111
112
  target_platforms: Optional[List[model_types.SupportedTargetPlatformType]] = None,
112
113
  python_version: Optional[str] = None,
113
114
  signatures: Optional[Dict[str, model_signature.ModelSignature]] = None,
@@ -140,6 +141,13 @@ class Registry:
140
141
  See https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/container for more.
141
142
  Models with pip requirements specified will not be executable in Snowflake Warehouse where all
142
143
  dependencies must be retrieved from Snowflake Anaconda Channel.
144
+ artifact_repository_map: Specifies a mapping of package channels or platforms to custom artifact
145
+ repositories. Defaults to None. Currently, the mapping applies only to warehouse execution.
146
+ Note : This feature is currently in Private Preview; please contact your Snowflake account team
147
+ to enable it.
148
+ Format: {channel_name: artifact_repository_name}, where:
149
+ - channel_name: The name of the Conda package channel (e.g., 'condaforge') or 'pip' for pip packages.
150
+ - artifact_repository_name: The name or URL of the repository to fetch packages from.
143
151
  target_platforms: List of target platforms to run the model. The only acceptable inputs are a combination of
144
152
  {"WAREHOUSE", "SNOWPARK_CONTAINER_SERVICES"}. Defaults to None.
145
153
  python_version: Python version in which the model is run. Defaults to None.
@@ -210,6 +218,7 @@ class Registry:
210
218
  "metrics",
211
219
  "conda_dependencies",
212
220
  "pip_requirements",
221
+ "artifact_repository_map",
213
222
  "target_platforms",
214
223
  "python_version",
215
224
  "signatures",
@@ -225,6 +234,7 @@ class Registry:
225
234
  metrics: Optional[Dict[str, Any]] = None,
226
235
  conda_dependencies: Optional[List[str]] = None,
227
236
  pip_requirements: Optional[List[str]] = None,
237
+ artifact_repository_map: Optional[Dict[str, str]] = None,
228
238
  target_platforms: Optional[List[model_types.SupportedTargetPlatformType]] = None,
229
239
  python_version: Optional[str] = None,
230
240
  signatures: Optional[Dict[str, model_signature.ModelSignature]] = None,
@@ -259,6 +269,13 @@ class Registry:
259
269
  See https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/container for more.
260
270
  Models with pip requirements specified will not be executable in Snowflake Warehouse where all
261
271
  dependencies must be retrieved from Snowflake Anaconda Channel.
272
+ artifact_repository_map: Specifies a mapping of package channels or platforms to custom artifact
273
+ repositories. Defaults to None. Currently, the mapping applies only to warehouse execution.
274
+ Note : This feature is currently in Private Preview; please contact your Snowflake account team to
275
+ enable it.
276
+ Format: {channel_name: artifact_repository_name}, where:
277
+ - channel_name: The name of the Conda package channel (e.g., 'condaforge') or 'pip' for pip packages.
278
+ - artifact_repository_name: The name or URL of the repository to fetch packages from.
262
279
  target_platforms: List of target platforms to run the model. The only acceptable inputs are a combination of
263
280
  {"WAREHOUSE", "SNOWPARK_CONTAINER_SERVICES"}. Defaults to None.
264
281
  python_version: Python version in which the model is run. Defaults to None.
@@ -345,6 +362,7 @@ class Registry:
345
362
  metrics=metrics,
346
363
  conda_dependencies=conda_dependencies,
347
364
  pip_requirements=pip_requirements,
365
+ artifact_repository_map=artifact_repository_map,
348
366
  target_platforms=target_platforms,
349
367
  python_version=python_version,
350
368
  signatures=signatures,
snowflake/ml/version.py CHANGED
@@ -1 +1 @@
1
- VERSION="1.7.5"
1
+ VERSION="1.8.0"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: snowflake-ml-python
3
- Version: 1.7.5
3
+ Version: 1.8.0
4
4
  Summary: The machine learning client library that is used for interacting with Snowflake to build machine learning solutions.
5
5
  Author-email: "Snowflake, Inc" <support@snowflake.com>
6
6
  License:
@@ -251,7 +251,7 @@ Requires-Dist: retrying<2,>=1.3.3
251
251
  Requires-Dist: s3fs<2026,>=2024.6.1
252
252
  Requires-Dist: scikit-learn<1.6,>=1.4
253
253
  Requires-Dist: scipy<2,>=1.9
254
- Requires-Dist: snowflake-connector-python[pandas]<4,>=3.5.0
254
+ Requires-Dist: snowflake-connector-python[pandas]<4,>=3.12.0
255
255
  Requires-Dist: snowflake-snowpark-python!=1.26.0,<2,>=1.17.0
256
256
  Requires-Dist: sqlparse<1,>=0.4
257
257
  Requires-Dist: typing-extensions<5,>=4.1.0
@@ -261,14 +261,14 @@ Requires-Dist: catboost<2,>=1.2.0; extra == "all"
261
261
  Requires-Dist: keras<4,>=2.0.0; extra == "all"
262
262
  Requires-Dist: lightgbm<5,>=4.1.0; extra == "all"
263
263
  Requires-Dist: mlflow<3,>=2.16.0; extra == "all"
264
- Requires-Dist: sentence-transformers<3,>=2.7.0; extra == "all"
264
+ Requires-Dist: sentence-transformers<4,>=2.7.0; extra == "all"
265
265
  Requires-Dist: sentencepiece<0.2.0,>=0.1.95; extra == "all"
266
266
  Requires-Dist: shap<1,>=0.46.0; extra == "all"
267
267
  Requires-Dist: tensorflow<3,>=2.17.0; extra == "all"
268
268
  Requires-Dist: tokenizers<1,>=0.15.1; extra == "all"
269
269
  Requires-Dist: torch<3,>=2.0.1; extra == "all"
270
270
  Requires-Dist: torchdata<1,>=0.4; extra == "all"
271
- Requires-Dist: transformers<5,>=4.37.2; extra == "all"
271
+ Requires-Dist: transformers<5,>=4.39.3; extra == "all"
272
272
  Provides-Extra: catboost
273
273
  Requires-Dist: catboost<2,>=1.2.0; extra == "catboost"
274
274
  Provides-Extra: keras
@@ -287,11 +287,12 @@ Provides-Extra: torch
287
287
  Requires-Dist: torch<3,>=2.0.1; extra == "torch"
288
288
  Requires-Dist: torchdata<1,>=0.4; extra == "torch"
289
289
  Provides-Extra: transformers
290
- Requires-Dist: sentence-transformers<3,>=2.7.0; extra == "transformers"
290
+ Requires-Dist: sentence-transformers<4,>=2.7.0; extra == "transformers"
291
291
  Requires-Dist: sentencepiece<0.2.0,>=0.1.95; extra == "transformers"
292
292
  Requires-Dist: tokenizers<1,>=0.15.1; extra == "transformers"
293
293
  Requires-Dist: torch<3,>=2.0.1; extra == "transformers"
294
- Requires-Dist: transformers<5,>=4.37.2; extra == "transformers"
294
+ Requires-Dist: transformers<5,>=4.39.3; extra == "transformers"
295
+ Dynamic: license-file
295
296
 
296
297
  # Snowpark ML
297
298
 
@@ -401,10 +402,287 @@ NOTE: Version 1.7.0 is used as example here. Please choose the the latest versio
401
402
 
402
403
  # Release History
403
404
 
404
- ## 1.7.5
405
+ ## 1.8.0
406
+
407
+ ### Bug Fixes
408
+
409
+ - Modeling: Fix a bug in some metrics that allowed an unsupported version of numpy to be installed
410
+ automatically in the stored procedure, resulting in a numpy error on execution
411
+ - Registry: Fix a bug that leads to incorrect `Model is does not have _is_inference_api` error message when assigning
412
+ a supported model as a property of a CustomModel.
413
+ - Registry: Fix a bug that inference is not working when models with more than 500 input features
414
+ are deployed to SPCS.
415
+
416
+ ### Behavior Change
417
+
418
+ - Registry: With FeatureGroupSpec support, auto inferred model signature for `transformers.Pipeline` models have been
419
+ updated, including:
420
+ - Signature for fill-mask task has been changed from
421
+
422
+ ```python
423
+ ModelSignature(
424
+ inputs=[
425
+ FeatureSpec(name="inputs", dtype=DataType.STRING),
426
+ ],
427
+ outputs=[
428
+ FeatureSpec(name="outputs", dtype=DataType.STRING),
429
+ ],
430
+ )
431
+ ```
432
+
433
+ to
434
+
435
+ ```python
436
+ ModelSignature(
437
+ inputs=[
438
+ FeatureSpec(name="inputs", dtype=DataType.STRING),
439
+ ],
440
+ outputs=[
441
+ FeatureGroupSpec(
442
+ name="outputs",
443
+ specs=[
444
+ FeatureSpec(name="sequence", dtype=DataType.STRING),
445
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
446
+ FeatureSpec(name="token", dtype=DataType.INT64),
447
+ FeatureSpec(name="token_str", dtype=DataType.STRING),
448
+ ],
449
+ shape=(-1,),
450
+ ),
451
+ ],
452
+ )
453
+ ```
454
+
455
+ - Signature for token-classification task has been changed from
456
+
457
+ ```python
458
+ ModelSignature(
459
+ inputs=[
460
+ FeatureSpec(name="inputs", dtype=DataType.STRING),
461
+ ],
462
+ outputs=[
463
+ FeatureSpec(name="outputs", dtype=DataType.STRING),
464
+ ],
465
+ )
466
+ ```
467
+
468
+ to
469
+
470
+ ```python
471
+ ModelSignature(
472
+ inputs=[FeatureSpec(name="inputs", dtype=DataType.STRING)],
473
+ outputs=[
474
+ FeatureGroupSpec(
475
+ name="outputs",
476
+ specs=[
477
+ FeatureSpec(name="word", dtype=DataType.STRING),
478
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
479
+ FeatureSpec(name="entity", dtype=DataType.STRING),
480
+ FeatureSpec(name="index", dtype=DataType.INT64),
481
+ FeatureSpec(name="start", dtype=DataType.INT64),
482
+ FeatureSpec(name="end", dtype=DataType.INT64),
483
+ ],
484
+ shape=(-1,),
485
+ ),
486
+ ],
487
+ )
488
+ ```
489
+
490
+ - Signature for question-answering task when top_k is larger than 1 has been changed from
491
+
492
+ ```python
493
+ ModelSignature(
494
+ inputs=[
495
+ FeatureSpec(name="question", dtype=DataType.STRING),
496
+ FeatureSpec(name="context", dtype=DataType.STRING),
497
+ ],
498
+ outputs=[
499
+ FeatureSpec(name="outputs", dtype=DataType.STRING),
500
+ ],
501
+ )
502
+ ```
503
+
504
+ to
505
+
506
+ ```python
507
+ ModelSignature(
508
+ inputs=[
509
+ FeatureSpec(name="question", dtype=DataType.STRING),
510
+ FeatureSpec(name="context", dtype=DataType.STRING),
511
+ ],
512
+ outputs=[
513
+ FeatureGroupSpec(
514
+ name="answers",
515
+ specs=[
516
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
517
+ FeatureSpec(name="start", dtype=DataType.INT64),
518
+ FeatureSpec(name="end", dtype=DataType.INT64),
519
+ FeatureSpec(name="answer", dtype=DataType.STRING),
520
+ ],
521
+ shape=(-1,),
522
+ ),
523
+ ],
524
+ )
525
+ ```
526
+
527
+ - Signature for text-classification task when top_k is `None` has been changed from
528
+
529
+ ```python
530
+ ModelSignature(
531
+ inputs=[
532
+ FeatureSpec(name="text", dtype=DataType.STRING),
533
+ FeatureSpec(name="text_pair", dtype=DataType.STRING),
534
+ ],
535
+ outputs=[
536
+ FeatureSpec(name="label", dtype=DataType.STRING),
537
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
538
+ ],
539
+ )
540
+ ```
541
+
542
+ to
543
+
544
+ ```python
545
+ ModelSignature(
546
+ inputs=[
547
+ FeatureSpec(name="text", dtype=DataType.STRING),
548
+ ],
549
+ outputs=[
550
+ FeatureSpec(name="label", dtype=DataType.STRING),
551
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
552
+ ],
553
+ )
554
+ ```
555
+
556
+ - Signature for text-classification task when top_k is not `None` has been changed from
557
+
558
+ ```python
559
+ ModelSignature(
560
+ inputs=[
561
+ FeatureSpec(name="text", dtype=DataType.STRING),
562
+ FeatureSpec(name="text_pair", dtype=DataType.STRING),
563
+ ],
564
+ outputs=[
565
+ FeatureSpec(name="outputs", dtype=DataType.STRING),
566
+ ],
567
+ )
568
+ ```
569
+
570
+ to
571
+
572
+ ```python
573
+ ModelSignature(
574
+ inputs=[
575
+ FeatureSpec(name="text", dtype=DataType.STRING),
576
+ ],
577
+ outputs=[
578
+ FeatureGroupSpec(
579
+ name="labels",
580
+ specs=[
581
+ FeatureSpec(name="label", dtype=DataType.STRING),
582
+ FeatureSpec(name="score", dtype=DataType.DOUBLE),
583
+ ],
584
+ shape=(-1,),
585
+ ),
586
+ ],
587
+ )
588
+ ```
589
+
590
+ - Signature for text-generation task has been changed from
591
+
592
+ ```python
593
+ ModelSignature(
594
+ inputs=[FeatureSpec(name="inputs", dtype=DataType.STRING)],
595
+ outputs=[
596
+ FeatureSpec(name="outputs", dtype=DataType.STRING),
597
+ ],
598
+ )
599
+ ```
600
+
601
+ to
602
+
603
+ ```python
604
+ ModelSignature(
605
+ inputs=[
606
+ FeatureGroupSpec(
607
+ name="inputs",
608
+ specs=[
609
+ FeatureSpec(name="role", dtype=DataType.STRING),
610
+ FeatureSpec(name="content", dtype=DataType.STRING),
611
+ ],
612
+ shape=(-1,),
613
+ ),
614
+ ],
615
+ outputs=[
616
+ FeatureGroupSpec(
617
+ name="outputs",
618
+ specs=[
619
+ FeatureSpec(name="generated_text", dtype=DataType.STRING),
620
+ ],
621
+ shape=(-1,),
622
+ )
623
+ ],
624
+ )
625
+ ```
626
+
627
+ - Registry: PyTorch and TensorFlow models now expect a single tensor input/output by default when logging to Model
628
+ Registry. To use multiple tensors (previous behavior), set `options={"multiple_inputs": True}`.
629
+
630
+ Example with single tensor input:
631
+
632
+ ```python
633
+ import torch
634
+
635
+ class TorchModel(torch.nn.Module):
636
+ def __init__(self, n_input: int, n_hidden: int, n_out: int, dtype: torch.dtype = torch.float32) -> None:
637
+ super().__init__()
638
+ self.model = torch.nn.Sequential(
639
+ torch.nn.Linear(n_input, n_hidden, dtype=dtype),
640
+ torch.nn.ReLU(),
641
+ torch.nn.Linear(n_hidden, n_out, dtype=dtype),
642
+ torch.nn.Sigmoid(),
643
+ )
644
+
645
+ def forward(self, tensor: torch.Tensor) -> torch.Tensor:
646
+ return cast(torch.Tensor, self.model(tensor))
647
+
648
+ # Sample usage:
649
+ data_x = torch.rand(size=(batch_size, n_input))
650
+
651
+ # Log model with single tensor
652
+ reg.log_model(
653
+ model=model,
654
+ ...,
655
+ sample_input_data=data_x
656
+ )
657
+
658
+ # Run inference with single tensor
659
+ mv.run(data_x)
660
+ ```
661
+
662
+ For multiple tensor inputs/outputs, use:
663
+
664
+ ```python
665
+ reg.log_model(
666
+ model=model,
667
+ ...,
668
+ sample_input_data=[data_x_1, data_x_2],
669
+ options={"multiple_inputs": True}
670
+ )
671
+ ```
672
+
673
+ - Registry: Default `enable_explainability` to False when the model can be deployed to Snowpark Container Services.
674
+
675
+ ### New Features
676
+
677
+ - Registry: Added support to single `torch.Tensor`, `tensorflow.Tensor` and `tensorflow.Variable` as input or output
678
+ data.
679
+ - Registry: Support [`xgboost.DMatrix`](https://xgboost.readthedocs.io/en/stable/python/python_api.html#xgboost.DMatrix)
680
+ datatype for XGBoost models.
681
+
682
+ ## 1.7.5 (03-06-2025)
405
683
 
406
684
  - Support Python 3.12.
407
- - Explainability: Support native and snowml sklearn pipeline
685
+ - Explainability: Support native and snowflake.ml.modeling sklearn pipeline
408
686
 
409
687
  ### Bug Fixes
410
688
 
@@ -421,8 +699,6 @@ NOTE: Version 1.7.0 is used as example here. Please choose the the latest versio
421
699
  `ValueError(f"{self.entrypoint} must be a subpath of {self.source}")`
422
700
  - ML Job (PrPr): Fixed a bug in Ray cluster startup config which caused certain Runtime APIs to fail
423
701
 
424
- ### Behavior Change
425
-
426
702
  ### New Features
427
703
 
428
704
  - Registry: Added support for handling Hugging Face model configurations with auto-mapping functionality.