snowflake-ml-python 1.7.2__py3-none-any.whl → 1.7.4__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 (237) hide show
  1. snowflake/cortex/__init__.py +16 -8
  2. snowflake/cortex/_classify_text.py +12 -1
  3. snowflake/cortex/_complete.py +101 -13
  4. snowflake/cortex/_embed_text_1024.py +9 -2
  5. snowflake/cortex/_embed_text_768.py +9 -2
  6. snowflake/cortex/_extract_answer.py +9 -2
  7. snowflake/cortex/_sentiment.py +9 -2
  8. snowflake/cortex/_summarize.py +9 -2
  9. snowflake/cortex/_translate.py +9 -2
  10. snowflake/ml/_internal/env_utils.py +7 -52
  11. snowflake/ml/_internal/platform_capabilities.py +87 -0
  12. snowflake/ml/_internal/utils/identifier.py +4 -2
  13. snowflake/ml/data/__init__.py +3 -0
  14. snowflake/ml/data/_internal/arrow_ingestor.py +4 -4
  15. snowflake/ml/data/data_connector.py +53 -11
  16. snowflake/ml/data/data_ingestor.py +2 -1
  17. snowflake/ml/data/torch_utils.py +18 -5
  18. snowflake/ml/dataset/dataset.py +0 -1
  19. snowflake/ml/feature_store/examples/example_helper.py +2 -1
  20. snowflake/ml/fileset/fileset.py +24 -18
  21. snowflake/ml/jobs/__init__.py +21 -0
  22. snowflake/ml/jobs/_utils/constants.py +51 -0
  23. snowflake/ml/jobs/_utils/payload_utils.py +352 -0
  24. snowflake/ml/jobs/_utils/spec_utils.py +298 -0
  25. snowflake/ml/jobs/_utils/types.py +39 -0
  26. snowflake/ml/jobs/decorators.py +91 -0
  27. snowflake/ml/jobs/job.py +113 -0
  28. snowflake/ml/jobs/manager.py +298 -0
  29. snowflake/ml/model/_client/model/model_version_impl.py +5 -3
  30. snowflake/ml/model/_client/ops/model_ops.py +13 -8
  31. snowflake/ml/model/_client/ops/service_ops.py +1 -11
  32. snowflake/ml/model/_client/sql/model_version.py +11 -0
  33. snowflake/ml/model/_client/sql/service.py +13 -6
  34. snowflake/ml/model/_model_composer/model_composer.py +8 -3
  35. snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +20 -1
  36. snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +1 -0
  37. snowflake/ml/model/_model_composer/model_method/constants.py +1 -0
  38. snowflake/ml/model/_model_composer/model_method/function_generator.py +2 -0
  39. snowflake/ml/model/_model_composer/model_method/infer_function.py_template +1 -1
  40. snowflake/ml/model/_model_composer/model_method/infer_partitioned.py_template +1 -1
  41. snowflake/ml/model/_model_composer/model_method/infer_table_function.py_template +1 -1
  42. snowflake/ml/model/_model_composer/model_method/model_method.py +9 -1
  43. snowflake/ml/model/_model_composer/model_user_file/model_user_file.py +27 -0
  44. snowflake/ml/model/_packager/model_handlers/_utils.py +39 -5
  45. snowflake/ml/model/_packager/model_handlers/catboost.py +3 -3
  46. snowflake/ml/model/_packager/model_handlers/custom.py +1 -2
  47. snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +6 -1
  48. snowflake/ml/model/_packager/model_handlers/lightgbm.py +5 -3
  49. snowflake/ml/model/_packager/model_handlers/sentence_transformers.py +55 -20
  50. snowflake/ml/model/_packager/model_handlers/sklearn.py +9 -10
  51. snowflake/ml/model/_packager/model_handlers/snowmlmodel.py +66 -28
  52. snowflake/ml/model/_packager/model_handlers/tensorflow.py +70 -17
  53. snowflake/ml/model/_packager/model_handlers/xgboost.py +3 -3
  54. snowflake/ml/model/_packager/model_meta/model_meta.py +3 -0
  55. snowflake/ml/model/_packager/model_meta/model_meta_schema.py +6 -1
  56. snowflake/ml/model/_packager/model_runtime/_snowml_inference_alternative_requirements.py +2 -2
  57. snowflake/ml/model/_packager/model_task/model_task_utils.py +3 -2
  58. snowflake/ml/model/_signatures/base_handler.py +1 -2
  59. snowflake/ml/model/_signatures/builtins_handler.py +2 -2
  60. snowflake/ml/model/_signatures/numpy_handler.py +6 -7
  61. snowflake/ml/model/_signatures/pandas_handler.py +3 -3
  62. snowflake/ml/model/_signatures/pytorch_handler.py +2 -5
  63. snowflake/ml/model/_signatures/snowpark_handler.py +11 -5
  64. snowflake/ml/model/_signatures/tensorflow_handler.py +2 -7
  65. snowflake/ml/model/model_signature.py +17 -4
  66. snowflake/ml/model/type_hints.py +1 -0
  67. snowflake/ml/modeling/_internal/model_trainer_builder.py +0 -8
  68. snowflake/ml/modeling/_internal/model_transformer_builder.py +0 -13
  69. snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +6 -3
  70. snowflake/ml/modeling/cluster/affinity_propagation.py +6 -3
  71. snowflake/ml/modeling/cluster/agglomerative_clustering.py +6 -3
  72. snowflake/ml/modeling/cluster/birch.py +6 -3
  73. snowflake/ml/modeling/cluster/bisecting_k_means.py +6 -3
  74. snowflake/ml/modeling/cluster/dbscan.py +6 -3
  75. snowflake/ml/modeling/cluster/feature_agglomeration.py +6 -3
  76. snowflake/ml/modeling/cluster/k_means.py +6 -3
  77. snowflake/ml/modeling/cluster/mean_shift.py +6 -3
  78. snowflake/ml/modeling/cluster/mini_batch_k_means.py +6 -3
  79. snowflake/ml/modeling/cluster/optics.py +6 -3
  80. snowflake/ml/modeling/cluster/spectral_biclustering.py +6 -3
  81. snowflake/ml/modeling/cluster/spectral_clustering.py +6 -3
  82. snowflake/ml/modeling/cluster/spectral_coclustering.py +6 -3
  83. snowflake/ml/modeling/compose/column_transformer.py +6 -3
  84. snowflake/ml/modeling/compose/transformed_target_regressor.py +6 -3
  85. snowflake/ml/modeling/covariance/elliptic_envelope.py +6 -3
  86. snowflake/ml/modeling/covariance/empirical_covariance.py +6 -3
  87. snowflake/ml/modeling/covariance/graphical_lasso.py +6 -3
  88. snowflake/ml/modeling/covariance/graphical_lasso_cv.py +6 -3
  89. snowflake/ml/modeling/covariance/ledoit_wolf.py +6 -3
  90. snowflake/ml/modeling/covariance/min_cov_det.py +6 -3
  91. snowflake/ml/modeling/covariance/oas.py +6 -3
  92. snowflake/ml/modeling/covariance/shrunk_covariance.py +6 -3
  93. snowflake/ml/modeling/decomposition/dictionary_learning.py +6 -3
  94. snowflake/ml/modeling/decomposition/factor_analysis.py +6 -3
  95. snowflake/ml/modeling/decomposition/fast_ica.py +6 -3
  96. snowflake/ml/modeling/decomposition/incremental_pca.py +6 -3
  97. snowflake/ml/modeling/decomposition/kernel_pca.py +6 -3
  98. snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +6 -3
  99. snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +6 -3
  100. snowflake/ml/modeling/decomposition/pca.py +6 -3
  101. snowflake/ml/modeling/decomposition/sparse_pca.py +6 -3
  102. snowflake/ml/modeling/decomposition/truncated_svd.py +6 -3
  103. snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +6 -3
  104. snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +6 -3
  105. snowflake/ml/modeling/ensemble/ada_boost_classifier.py +6 -3
  106. snowflake/ml/modeling/ensemble/ada_boost_regressor.py +6 -3
  107. snowflake/ml/modeling/ensemble/bagging_classifier.py +6 -3
  108. snowflake/ml/modeling/ensemble/bagging_regressor.py +6 -3
  109. snowflake/ml/modeling/ensemble/extra_trees_classifier.py +6 -3
  110. snowflake/ml/modeling/ensemble/extra_trees_regressor.py +6 -3
  111. snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +6 -3
  112. snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +6 -3
  113. snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +6 -3
  114. snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +6 -3
  115. snowflake/ml/modeling/ensemble/isolation_forest.py +6 -3
  116. snowflake/ml/modeling/ensemble/random_forest_classifier.py +6 -3
  117. snowflake/ml/modeling/ensemble/random_forest_regressor.py +6 -3
  118. snowflake/ml/modeling/ensemble/stacking_regressor.py +6 -3
  119. snowflake/ml/modeling/ensemble/voting_classifier.py +6 -3
  120. snowflake/ml/modeling/ensemble/voting_regressor.py +6 -3
  121. snowflake/ml/modeling/feature_selection/generic_univariate_select.py +6 -3
  122. snowflake/ml/modeling/feature_selection/select_fdr.py +6 -3
  123. snowflake/ml/modeling/feature_selection/select_fpr.py +6 -3
  124. snowflake/ml/modeling/feature_selection/select_fwe.py +6 -3
  125. snowflake/ml/modeling/feature_selection/select_k_best.py +6 -3
  126. snowflake/ml/modeling/feature_selection/select_percentile.py +6 -3
  127. snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +6 -3
  128. snowflake/ml/modeling/feature_selection/variance_threshold.py +6 -3
  129. snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +6 -3
  130. snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +6 -3
  131. snowflake/ml/modeling/impute/iterative_imputer.py +6 -3
  132. snowflake/ml/modeling/impute/knn_imputer.py +6 -3
  133. snowflake/ml/modeling/impute/missing_indicator.py +6 -3
  134. snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +6 -3
  135. snowflake/ml/modeling/kernel_approximation/nystroem.py +6 -3
  136. snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +6 -3
  137. snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +6 -3
  138. snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +6 -3
  139. snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +6 -3
  140. snowflake/ml/modeling/lightgbm/lgbm_classifier.py +6 -3
  141. snowflake/ml/modeling/lightgbm/lgbm_regressor.py +6 -3
  142. snowflake/ml/modeling/linear_model/ard_regression.py +6 -3
  143. snowflake/ml/modeling/linear_model/bayesian_ridge.py +6 -3
  144. snowflake/ml/modeling/linear_model/elastic_net.py +6 -3
  145. snowflake/ml/modeling/linear_model/elastic_net_cv.py +6 -3
  146. snowflake/ml/modeling/linear_model/gamma_regressor.py +6 -3
  147. snowflake/ml/modeling/linear_model/huber_regressor.py +6 -3
  148. snowflake/ml/modeling/linear_model/lars.py +6 -3
  149. snowflake/ml/modeling/linear_model/lars_cv.py +6 -3
  150. snowflake/ml/modeling/linear_model/lasso.py +6 -3
  151. snowflake/ml/modeling/linear_model/lasso_cv.py +6 -3
  152. snowflake/ml/modeling/linear_model/lasso_lars.py +6 -3
  153. snowflake/ml/modeling/linear_model/lasso_lars_cv.py +6 -3
  154. snowflake/ml/modeling/linear_model/lasso_lars_ic.py +6 -3
  155. snowflake/ml/modeling/linear_model/linear_regression.py +6 -3
  156. snowflake/ml/modeling/linear_model/logistic_regression.py +6 -3
  157. snowflake/ml/modeling/linear_model/logistic_regression_cv.py +6 -3
  158. snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +6 -3
  159. snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +6 -3
  160. snowflake/ml/modeling/linear_model/multi_task_lasso.py +6 -3
  161. snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +6 -3
  162. snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +6 -3
  163. snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +6 -3
  164. snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +6 -3
  165. snowflake/ml/modeling/linear_model/perceptron.py +6 -3
  166. snowflake/ml/modeling/linear_model/poisson_regressor.py +6 -3
  167. snowflake/ml/modeling/linear_model/ransac_regressor.py +6 -3
  168. snowflake/ml/modeling/linear_model/ridge.py +6 -3
  169. snowflake/ml/modeling/linear_model/ridge_classifier.py +6 -3
  170. snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +6 -3
  171. snowflake/ml/modeling/linear_model/ridge_cv.py +6 -3
  172. snowflake/ml/modeling/linear_model/sgd_classifier.py +6 -3
  173. snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +6 -3
  174. snowflake/ml/modeling/linear_model/sgd_regressor.py +6 -3
  175. snowflake/ml/modeling/linear_model/theil_sen_regressor.py +6 -3
  176. snowflake/ml/modeling/linear_model/tweedie_regressor.py +6 -3
  177. snowflake/ml/modeling/manifold/isomap.py +6 -3
  178. snowflake/ml/modeling/manifold/mds.py +6 -3
  179. snowflake/ml/modeling/manifold/spectral_embedding.py +6 -3
  180. snowflake/ml/modeling/manifold/tsne.py +6 -3
  181. snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +6 -3
  182. snowflake/ml/modeling/mixture/gaussian_mixture.py +6 -3
  183. snowflake/ml/modeling/model_selection/grid_search_cv.py +17 -2
  184. snowflake/ml/modeling/model_selection/randomized_search_cv.py +17 -2
  185. snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +6 -3
  186. snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +6 -3
  187. snowflake/ml/modeling/multiclass/output_code_classifier.py +6 -3
  188. snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +6 -3
  189. snowflake/ml/modeling/naive_bayes/categorical_nb.py +6 -3
  190. snowflake/ml/modeling/naive_bayes/complement_nb.py +6 -3
  191. snowflake/ml/modeling/naive_bayes/gaussian_nb.py +6 -3
  192. snowflake/ml/modeling/naive_bayes/multinomial_nb.py +6 -3
  193. snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +6 -3
  194. snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +6 -3
  195. snowflake/ml/modeling/neighbors/kernel_density.py +6 -3
  196. snowflake/ml/modeling/neighbors/local_outlier_factor.py +6 -3
  197. snowflake/ml/modeling/neighbors/nearest_centroid.py +6 -3
  198. snowflake/ml/modeling/neighbors/nearest_neighbors.py +6 -3
  199. snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +6 -3
  200. snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +6 -3
  201. snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +6 -3
  202. snowflake/ml/modeling/neural_network/bernoulli_rbm.py +6 -3
  203. snowflake/ml/modeling/neural_network/mlp_classifier.py +6 -3
  204. snowflake/ml/modeling/neural_network/mlp_regressor.py +6 -3
  205. snowflake/ml/modeling/pipeline/pipeline.py +16 -178
  206. snowflake/ml/modeling/preprocessing/polynomial_features.py +6 -3
  207. snowflake/ml/modeling/semi_supervised/label_propagation.py +6 -3
  208. snowflake/ml/modeling/semi_supervised/label_spreading.py +6 -3
  209. snowflake/ml/modeling/svm/linear_svc.py +6 -3
  210. snowflake/ml/modeling/svm/linear_svr.py +6 -3
  211. snowflake/ml/modeling/svm/nu_svc.py +6 -3
  212. snowflake/ml/modeling/svm/nu_svr.py +6 -3
  213. snowflake/ml/modeling/svm/svc.py +6 -3
  214. snowflake/ml/modeling/svm/svr.py +6 -3
  215. snowflake/ml/modeling/tree/decision_tree_classifier.py +6 -3
  216. snowflake/ml/modeling/tree/decision_tree_regressor.py +6 -3
  217. snowflake/ml/modeling/tree/extra_tree_classifier.py +6 -3
  218. snowflake/ml/modeling/tree/extra_tree_regressor.py +6 -3
  219. snowflake/ml/modeling/xgboost/xgb_classifier.py +167 -91
  220. snowflake/ml/modeling/xgboost/xgb_regressor.py +166 -88
  221. snowflake/ml/modeling/xgboost/xgbrf_classifier.py +166 -88
  222. snowflake/ml/modeling/xgboost/xgbrf_regressor.py +166 -88
  223. snowflake/ml/monitoring/_client/model_monitor_sql_client.py +4 -4
  224. snowflake/ml/registry/_manager/model_manager.py +70 -33
  225. snowflake/ml/registry/registry.py +41 -22
  226. snowflake/ml/version.py +1 -1
  227. {snowflake_ml_python-1.7.2.dist-info → snowflake_ml_python-1.7.4.dist-info}/METADATA +63 -19
  228. {snowflake_ml_python-1.7.2.dist-info → snowflake_ml_python-1.7.4.dist-info}/RECORD +231 -226
  229. {snowflake_ml_python-1.7.2.dist-info → snowflake_ml_python-1.7.4.dist-info}/WHEEL +1 -1
  230. snowflake/ml/_internal/utils/retryable_http.py +0 -39
  231. snowflake/ml/fileset/parquet_parser.py +0 -170
  232. snowflake/ml/fileset/tf_dataset.py +0 -88
  233. snowflake/ml/fileset/torch_datapipe.py +0 -57
  234. snowflake/ml/modeling/_internal/ml_runtime_implementations/ml_runtime_handlers.py +0 -151
  235. snowflake/ml/modeling/_internal/ml_runtime_implementations/ml_runtime_trainer.py +0 -66
  236. {snowflake_ml_python-1.7.2.dist-info → snowflake_ml_python-1.7.4.dist-info}/LICENSE.txt +0 -0
  237. {snowflake_ml_python-1.7.2.dist-info → snowflake_ml_python-1.7.4.dist-info}/top_level.txt +0 -0
@@ -117,41 +117,49 @@ class Registry:
117
117
  options: Optional[model_types.ModelSaveOption] = None,
118
118
  ) -> ModelVersion:
119
119
  """
120
- Log a model with various parameters and metadata.
120
+ Log a model with various parameters and metadata, or a ModelVersion object.
121
121
 
122
122
  Args:
123
- model: Model object of supported types such as Scikit-learn, XGBoost, LightGBM, Snowpark ML,
124
- PyTorch, TorchScript, Tensorflow, Tensorflow Keras, MLFlow, HuggingFace Pipeline,
125
- Sentence Transformers, or Custom Model.
126
- model_name: Name to identify the model.
123
+ model: Supported model or ModelVersion object.
124
+ - Supported model: Model object of supported types such as Scikit-learn, XGBoost, LightGBM, Snowpark ML,
125
+ PyTorch, TorchScript, Tensorflow, Tensorflow Keras, MLFlow, HuggingFace Pipeline, Sentence Transformers,
126
+ or Custom Model.
127
+ - ModelVersion: Source ModelVersion object used to create the new ModelVersion object.
128
+ model_name: Name to identify the model. This must be a valid Snowflake SQL Identifier. Alphanumeric
129
+ characters and underscores are permitted.
130
+ See https://docs.snowflake.com/en/sql-reference/identifiers-syntax for more.
127
131
  version_name: Version identifier for the model. Combination of model_name and version_name must be unique.
128
132
  If not specified, a random name will be generated.
129
133
  comment: Comment associated with the model version. Defaults to None.
130
134
  metrics: A JSON serializable dictionary containing metrics linked to the model version. Defaults to None.
131
- signatures: Model data signatures for inputs and outputs for various target methods. If it is None,
132
- sample_input_data would be used to infer the signatures for those models that cannot automatically
133
- infer the signature. Defaults to None.
134
- sample_input_data: Sample input data to infer model signatures from.
135
- It would also be used as background data in explanation and to capture data lineage. Defaults to None.
136
135
  conda_dependencies: List of Conda package specifications. Use "[channel::]package [operator version]" syntax
137
136
  to specify a dependency. It is a recommended way to specify your dependencies using conda. When channel
138
137
  is not specified, Snowflake Anaconda Channel will be used. Defaults to None.
139
138
  pip_requirements: List of Pip package specifications. Defaults to None.
140
- Currently it is not supported since Model can only executed in Snowflake Warehouse where all
141
- dependencies are required to be retrieved from Snowflake Anaconda Channel.
139
+ Models with pip requirements are currently only runnable in Snowpark Container Services.
140
+ See https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/container for more.
141
+ Models with pip requirements specified will not be executable in Snowflake Warehouse where all
142
+ dependencies must be retrieved from Snowflake Anaconda Channel.
142
143
  target_platforms: List of target platforms to run the model. The only acceptable inputs are a combination of
143
144
  {"WAREHOUSE", "SNOWPARK_CONTAINER_SERVICES"}. Defaults to None.
144
145
  python_version: Python version in which the model is run. Defaults to None.
146
+ signatures: Model data signatures for inputs and outputs for various target methods. If it is None,
147
+ sample_input_data would be used to infer the signatures for those models that cannot automatically
148
+ infer the signature. If not None, sample_input_data should not be specified. Defaults to None.
149
+ sample_input_data: Sample input data to infer model signatures from.
150
+ It would also be used as background data in explanation and to capture data lineage. Defaults to None.
145
151
  code_paths: List of directories containing code to import. Defaults to None.
146
152
  ext_modules: List of external modules to pickle with the model object.
147
153
  Only supported when logging the following types of model:
148
154
  Scikit-learn, Snowpark ML, PyTorch, TorchScript and Custom Model. Defaults to None.
149
155
  options (Dict[str, Any], optional): Additional model saving options.
156
+
150
157
  Model Saving Options include:
158
+
151
159
  - embed_local_ml_library: Embed local Snowpark ML into the code directory or folder.
152
160
  Override to True if the local Snowpark ML version is not available in the Snowflake Anaconda
153
161
  Channel. Otherwise, defaults to False
154
- - relax_version: Whether or not relax the version constraints of the dependencies when running in the
162
+ - relax_version: Whether to relax the version constraints of the dependencies when running in the
155
163
  Warehouse. It detects any ==x.y.z in specifiers and replaced with >=x.y, <(x+1). Defaults to True.
156
164
  - function_type: Set the method function type globally. To set method function types individually see
157
165
  function_type in model_options.
@@ -163,7 +171,10 @@ class Registry:
163
171
  - max_batch_size: Maximum batch size that the method could accept in the Snowflake Warehouse.
164
172
  Defaults to None, determined automatically by Snowflake.
165
173
  - function_type: One of supported model method function types (FUNCTION or TABLE_FUNCTION).
174
+ Returns:
175
+ ModelVersion: ModelVersion object corresponding to the model just logged.
166
176
  """
177
+
167
178
  ...
168
179
 
169
180
  @overload
@@ -214,6 +225,7 @@ class Registry:
214
225
  python_version: Optional[str] = None,
215
226
  signatures: Optional[Dict[str, model_signature.ModelSignature]] = None,
216
227
  sample_input_data: Optional[model_types.SupportedDataType] = None,
228
+ user_files: Optional[Dict[str, List[str]]] = None,
217
229
  code_paths: Optional[List[str]] = None,
218
230
  ext_modules: Optional[List[ModuleType]] = None,
219
231
  task: model_types.Task = model_types.Task.UNKNOWN,
@@ -228,25 +240,31 @@ class Registry:
228
240
  PyTorch, TorchScript, Tensorflow, Tensorflow Keras, MLFlow, HuggingFace Pipeline, Sentence Transformers,
229
241
  or Custom Model.
230
242
  - ModelVersion: Source ModelVersion object used to create the new ModelVersion object.
231
- model_name: Name to identify the model.
243
+ model_name: Name to identify the model. This must be a valid Snowflake SQL Identifier. Alphanumeric
244
+ characters and underscores are permitted.
245
+ See https://docs.snowflake.com/en/sql-reference/identifiers-syntax for more.
232
246
  version_name: Version identifier for the model. Combination of model_name and version_name must be unique.
233
247
  If not specified, a random name will be generated.
234
248
  comment: Comment associated with the model version. Defaults to None.
235
249
  metrics: A JSON serializable dictionary containing metrics linked to the model version. Defaults to None.
236
- signatures: Model data signatures for inputs and outputs for various target methods. If it is None,
237
- sample_input_data would be used to infer the signatures for those models that cannot automatically
238
- infer the signature. If not None, sample_input_data should not be specified. Defaults to None.
239
- sample_input_data: Sample input data to infer model signatures from.
240
- It would also be used as background data in explanation and to capture data lineage. Defaults to None.
241
250
  conda_dependencies: List of Conda package specifications. Use "[channel::]package [operator version]" syntax
242
251
  to specify a dependency. It is a recommended way to specify your dependencies using conda. When channel
243
252
  is not specified, Snowflake Anaconda Channel will be used. Defaults to None.
244
253
  pip_requirements: List of Pip package specifications. Defaults to None.
245
- Currently it is not supported since Model can only executed in Snowflake Warehouse where all
246
- dependencies are required to be retrieved from Snowflake Anaconda Channel.
254
+ Models with pip requirements are currently only runnable in Snowpark Container Services.
255
+ See https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/container for more.
256
+ Models with pip requirements specified will not be executable in Snowflake Warehouse where all
257
+ dependencies must be retrieved from Snowflake Anaconda Channel.
247
258
  target_platforms: List of target platforms to run the model. The only acceptable inputs are a combination of
248
259
  {"WAREHOUSE", "SNOWPARK_CONTAINER_SERVICES"}. Defaults to None.
249
260
  python_version: Python version in which the model is run. Defaults to None.
261
+ signatures: Model data signatures for inputs and outputs for various target methods. If it is None,
262
+ sample_input_data would be used to infer the signatures for those models that cannot automatically
263
+ infer the signature. If not None, sample_input_data should not be specified. Defaults to None.
264
+ sample_input_data: Sample input data to infer model signatures from.
265
+ It would also be used as background data in explanation and to capture data lineage. Defaults to None.
266
+ user_files: Dictionary where the keys are subdirectories, and values are lists of local file name
267
+ strings. The local file name strings can include wildcards (? or *) for matching multiple files.
250
268
  code_paths: List of directories containing code to import. Defaults to None.
251
269
  ext_modules: List of external modules to pickle with the model object.
252
270
  Only supported when logging the following types of model:
@@ -261,7 +279,7 @@ class Registry:
261
279
  - embed_local_ml_library: Embed local Snowpark ML into the code directory or folder.
262
280
  Override to True if the local Snowpark ML version is not available in the Snowflake Anaconda
263
281
  Channel. Otherwise, defaults to False
264
- - relax_version: Whether or not relax the version constraints of the dependencies when running in the
282
+ - relax_version: Whether to relax the version constraints of the dependencies when running in the
265
283
  Warehouse. It detects any ==x.y.z in specifiers and replaced with >=x.y, <(x+1). Defaults to True.
266
284
  - function_type: Set the method function type globally. To set method function types individually see
267
285
  function_type in model_options.
@@ -301,6 +319,7 @@ class Registry:
301
319
  python_version=python_version,
302
320
  signatures=signatures,
303
321
  sample_input_data=sample_input_data,
322
+ user_files=user_files,
304
323
  code_paths=code_paths,
305
324
  ext_modules=ext_modules,
306
325
  task=task,
snowflake/ml/version.py CHANGED
@@ -1 +1 @@
1
- VERSION="1.7.2"
1
+ VERSION="1.7.4"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: snowflake-ml-python
3
- Version: 1.7.2
3
+ Version: 1.7.4
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:
@@ -233,11 +233,11 @@ Requires-Python: <3.12,>=3.9
233
233
  Description-Content-Type: text/markdown
234
234
  License-File: LICENSE.txt
235
235
  Requires-Dist: absl-py<2,>=0.15
236
- Requires-Dist: anyio<4,>=3.5.0
236
+ Requires-Dist: anyio<5,>=3.5.0
237
237
  Requires-Dist: cachetools<6,>=3.1.1
238
238
  Requires-Dist: cloudpickle>=2.0.0
239
239
  Requires-Dist: cryptography
240
- Requires-Dist: fsspec[http]<2024,>=2022.11
240
+ Requires-Dist: fsspec[http]<2026,>=2024.6.1
241
241
  Requires-Dist: importlib_resources<7,>=6.1.1
242
242
  Requires-Dist: numpy<2,>=1.23
243
243
  Requires-Dist: packaging<25,>=20.9
@@ -247,23 +247,24 @@ Requires-Dist: pyjwt<3,>=2.0.0
247
247
  Requires-Dist: pytimeparse<2,>=1.1.8
248
248
  Requires-Dist: pyyaml<7,>=6.0
249
249
  Requires-Dist: retrying<2,>=1.3.3
250
- Requires-Dist: s3fs<2024,>=2022.11
250
+ Requires-Dist: s3fs<2026,>=2024.6.1
251
251
  Requires-Dist: scikit-learn<1.6,>=1.4
252
252
  Requires-Dist: scipy<2,>=1.9
253
253
  Requires-Dist: snowflake-connector-python[pandas]<4,>=3.5.0
254
- Requires-Dist: snowflake-snowpark-python<2,>=1.17.0
254
+ Requires-Dist: snowflake-snowpark-python!=1.26.0,<2,>=1.17.0
255
255
  Requires-Dist: sqlparse<1,>=0.4
256
256
  Requires-Dist: typing-extensions<5,>=4.1.0
257
257
  Requires-Dist: xgboost<3,>=1.7.3
258
258
  Provides-Extra: all
259
259
  Requires-Dist: catboost<2,>=1.2.0; extra == "all"
260
+ Requires-Dist: huggingface_hub<0.26; extra == "all"
260
261
  Requires-Dist: lightgbm<5,>=4.1.0; extra == "all"
261
- Requires-Dist: mlflow<2.4,>=2.1.0; extra == "all"
262
+ Requires-Dist: mlflow<3,>=2.16.0; extra == "all"
262
263
  Requires-Dist: peft<1,>=0.5.0; extra == "all"
263
264
  Requires-Dist: sentence-transformers<3,>=2.2.2; extra == "all"
264
265
  Requires-Dist: sentencepiece<1,>=0.1.95; extra == "all"
265
266
  Requires-Dist: shap<1,>=0.46.0; extra == "all"
266
- Requires-Dist: tensorflow<3,>=2.10; extra == "all"
267
+ Requires-Dist: tensorflow<3,>=2.12.0; extra == "all"
267
268
  Requires-Dist: tokenizers<1,>=0.10; extra == "all"
268
269
  Requires-Dist: torch<2.3.0,>=2.0.1; extra == "all"
269
270
  Requires-Dist: torchdata<1,>=0.4; extra == "all"
@@ -275,15 +276,16 @@ Requires-Dist: lightgbm<5,>=4.1.0; extra == "lightgbm"
275
276
  Provides-Extra: llm
276
277
  Requires-Dist: peft<1,>=0.5.0; extra == "llm"
277
278
  Provides-Extra: mlflow
278
- Requires-Dist: mlflow<2.4,>=2.1.0; extra == "mlflow"
279
+ Requires-Dist: mlflow<3,>=2.16.0; extra == "mlflow"
279
280
  Provides-Extra: shap
280
281
  Requires-Dist: shap<1,>=0.46.0; extra == "shap"
281
282
  Provides-Extra: tensorflow
282
- Requires-Dist: tensorflow<3,>=2.10; extra == "tensorflow"
283
+ Requires-Dist: tensorflow<3,>=2.12.0; extra == "tensorflow"
283
284
  Provides-Extra: torch
284
285
  Requires-Dist: torch<2.3.0,>=2.0.1; extra == "torch"
285
286
  Requires-Dist: torchdata<1,>=0.4; extra == "torch"
286
287
  Provides-Extra: transformers
288
+ Requires-Dist: huggingface_hub<0.26; extra == "transformers"
287
289
  Requires-Dist: sentence-transformers<3,>=2.2.2; extra == "transformers"
288
290
  Requires-Dist: sentencepiece<1,>=0.1.95; extra == "transformers"
289
291
  Requires-Dist: tokenizers<1,>=0.10; extra == "transformers"
@@ -397,19 +399,67 @@ NOTE: Version 1.7.0 is used as example here. Please choose the the latest versio
397
399
 
398
400
  # Release History
399
401
 
400
- ## 1.7.2
402
+ ## 1.7.4
403
+
404
+ - FileSet: The `snowflake.ml.fileset.FileSet` has been deprecated and will be removed in a future version.
405
+ Use [snowflake.ml.dataset.Dataset](https://docs.snowflake.com/en/developer-guide/snowflake-ml/dataset) and
406
+ [snowflake.ml.data.DataConnector](https://docs.snowflake.com/en/developer-guide/snowpark-ml/reference/latest/api/data/snowflake.ml.data.data_connector.DataConnector)
407
+ instead.
401
408
 
402
409
  ### Bug Fixes
403
410
 
404
- - Model Explainability: Fix issue that explain is enabled for scikit-learn pipeline
405
- whose task is UNKNOWN and fails later when invoked.
411
+ - Registry: Fixed an issue that the hugging face pipeline is loaded using incorrect dtype.
412
+ - Registry: Fixed an issue that only 1 row is used when infer the model signature in the modeling model.
406
413
 
407
414
  ### Behavior Changes
408
415
 
416
+ - Registry: `ModelVersion.run` on a service would require redeploying the service once account opts into nested function.
417
+
418
+ ### New Features
419
+
420
+ - Add new `snowflake.ml.jobs` preview API for running headless workloads on SPCS using
421
+ [Container Runtime for ML](https://docs.snowflake.com/en/developer-guide/snowflake-ml/container-runtime-ml)
422
+ - Added `guardrails` option to Cortex `complete` function, enabling
423
+ [Cortex Guard](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#cortex-guard) support
424
+
425
+ ## 1.7.3 (2025-01-08)
426
+
427
+ - Added lowercase versions of Cortex functions, added deprecation warning to Capitalized versions.
428
+ - Bumped the requirements of `fsspec` and `s3fs` to `>=2024.6.1,<2026`
429
+ - Bumped the requirement of `mlflow` to `>=2.16.0, <3`
430
+ - Registry: Support 500+ features for model registry
431
+
432
+ ### Bug Fixes
433
+
434
+ - Registry: Fixed a bug when providing non-range index pandas DataFrame as the input to a `ModelVersion.run`.
435
+ - Registry: Improved random model version name generation to prevent collisions.
436
+ - Registry: Fix an issue when inferring signature or running inference with Snowpark data that has a column whose type
437
+ is `ARRAY` and contains `NULL` value.
438
+ - Registry: `ModelVersion.run` now accepts fully qualified service name.
439
+ - Monitoring: Fix issue in SDK with creating monitors using fully qualified names.
440
+ - Registry: Fix error in log_model for any sklearn models with only data pre-processing including pre-processing only
441
+ pipeline models due to default explainability enablement.
442
+
443
+ ### New Features
444
+
445
+ - Added `user_files` argument to `Registry.log_model` for including images or any extra file with the model.
446
+ - Registry: Added support for handling Hugging Face model configurations with auto-mapping functionality
447
+ - DataConnector: Add new `DataConnector.from_sql()` constructor
448
+ - Registry: Provided new arguments to `snowflake.ml.model.model_signature.infer_signature` method to specify rows limit
449
+ to be used when inferring the signature.
450
+
451
+ ## 1.7.2 (2024-11-21)
452
+
453
+ ### Bug Fixes
454
+
455
+ - Model Explainability: Fix issue that explain is enabled for scikit-learn pipeline
456
+ whose task is UNKNOWN and fails later when invoked.
457
+
409
458
  ### New Features
410
459
 
411
460
  - Registry: Support asynchronous model inference service creation with the `block` option
412
461
  in `ModelVersion.create_service()` set to True by default.
462
+ - Registry: Allow specify `batch_size` when inferencing using sentence-transformers model.
413
463
 
414
464
  ## 1.7.1 (2024-11-05)
415
465
 
@@ -424,8 +474,6 @@ signature inference.
424
474
  - Dataset: Fix missing `snowflake.ml.dataset.*` module exports in wheel.
425
475
  - Registry: Fix the issue that `tf_keras.Model` is not recognized as keras model when logging.
426
476
 
427
- ### Behavior Changes
428
-
429
477
  ### New Features
430
478
 
431
479
  - Registry: Option to `enable_monitoring` set to False by default. This will gate access to preview features of Model Monitoring.
@@ -674,10 +722,6 @@ data from explainablity and data lineage.
674
722
  - Modeling: Quick fix `import snowflake.ml.modeling.parameters.enable_anonymous_sproc` cannot be imported due to package
675
723
  dependency error.
676
724
 
677
- ### Behavior Changes
678
-
679
- ### New Features
680
-
681
725
  ## 1.5.1 (05-22-2024)
682
726
 
683
727
  ### Bug Fixes