Snowflake ML Python 版本说明

本文包含 Snowflake ML Python 的版本说明,包括以下内容(如果适用):

  • 行为变更

  • 新功能

  • 面向客户的错误修复

备注

这些说明未包含尚未公开宣布的功能的变更。此类功能可能会显示在 Snowflake ML Python 源代码中,但不会显示在公开的文档中。

有关文档,请参阅 Snowflake ML:端到端机器学习

验证 snowflake-ml-python

所有 Snowflake 包都带有签名,允许您验证其来源。要验证 snowflake.ml.python 包,请按照以下步骤操作:

  1. 安装 cosign。此示例使用 Go 安装:使用 Go 安装 cosign (https://edu.chainguard.dev/open-source/sigstore/cosign/how-to-install-cosign/#installing-cosign-with-go)。

  2. 从 PyPi (https://pypi.org/project/snowflake-ml-python/#files) 等存储库下载文件。

  3. 从 GitHub 版本页面 (https://github.com/snowflakedb/snowflake-ml-python/releases/) 下载该版本的 .sig 文件。

  4. 使用 cosign 验证签名。例如:

cosign verify-blob snowflake_ml_python-1.7.0.tar.gz --key snowflake-ml-python-1.7.0.pub --signature resources.linux.snowflake_ml_python-1.7.0.tar.gz.sig

cosign verify-blob snowflake_ml_python-1.7.0.tar.gz --key snowflake-ml-python-1.7.0.pub --signature resources.linux.snowflake_ml_python-1.7.0
Copy

备注

此示例使用包版本 1.7.0 的库和签名。使用您正在验证的版本的文件名。

弃用声明

  • snowflake.ml.fileset.FileSet 已弃用,并将在未来版本中移除。改为使用 snowflake.ml.dataset.Datasetsnowflake.ml.data.DataConnector

  • snowflake.ml.cortex 中的“CamelCase”函数名称已弃用,将在未来版本中移除。改为使用这些函数的“snake_case”名称。例如,使用 classify_text 代替 ClassifyText

  • partitioned_inference_api 装饰器已弃用,并将在未来版本中移除。请改用 custom_model.partitioned_api

  • MLJob.submit_* 方法的 additional_payloads 实参已被弃用,并将在未来版本中移除。请改用 imports 实参。

  • snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel 类已弃用,并将在未来版本中移除。

Version 1.24.0 (2026-01-22)

新功能

New Feature Store features:

  • 支持基于磁贴的聚合,使用全新的 Feature API,并通过预先计算的磁贴实现高效且时间点正确的时间序列特征计算。

新的模型注册表功能:

  • SentenceTransformer 模型现在支持自动签名推理。记录 SentenceTransformer 模型时,sample_input_data 是可选的。未提供样本输入数据时,将自动根据模型的嵌入维度推断签名。支持 encodeencode_queryencode_documentencode_queriesencode_documents 方法。

    import sentence_transformers
    from snowflake.ml.registry import Registry
    
    # Create model
    model = sentence_transformers.SentenceTransformer("all-MiniLM-L6-v2")
    
    # Log model without sample_input_data - signature is auto-inferred
    registry = Registry(session)
    mv = registry.log_model(
        model=model,
        model_name="my_sentence_transformer",
        version_name="v1",
    )
    
    # Run inference with auto-inferred signature (input: "text", output: "output")
    import pandas as pd
    result = mv.run(pd.DataFrame({"text": ["Hello world"]}))
    
    Copy

Version 1.23.0 (2026-01-165)

新功能

New ML Jobs features:

  • ML Jobs 现在支持 Python 3.11 和 Python 3.12。Jobs 会自动选择与客户端 Python 版本匹配的运行时环境。

错误修复

模型注册表错误修复:

  • HuggingFace 的词元分类(命名实体识别)模型中的空输出不再导致失败。

Model Serving bug fixes:

  • 容器状态现在可以正确报告,不应为空白。

版本 1.22.0(2026 年 1 月 9 日)

新功能

新的模型注册表功能:

  • 现在,您可以通过 Snowpark Container Services (SPCS) 作业远程记录转换器管道模型。

    # create reference to the model
    model = huggingface.TransformersPipeline(
        model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
        task="text-generation",
    )
    
    # Remotely log the model, a SPCS job will run async and log the model
    mv = registry.log_model(
        model=model,
        model_name="tinyllama_remote_log",
        target_platforms=["SNOWPARK_CONTAINER_SERVICES"],
        signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
    )
    
    Copy

版本 1.21.0(2026 年 1 月 5 日)

行为变更

ML 作业行为变更:

  • additional_payloads 参数的行为发生了变化。使用 imports 实参声明额外依赖项,例如 ZIP 文件和 Python 模块。本地目录和 Python 文件会自动压缩,其内部布局由指定的导入路径决定。导入路径仅适用于本地目录、Python 文件和暂存的 Python 文件;对其他导入类型无影响。在暂存区中引用文件时,仅支持单个文件,不支持目录。

实验跟踪行为变更:

  • ExperimentTracking 现在为单例类。

错误修复

实验跟踪错误修复:

  • 达到 log_metricslog_params 的运行元数据大小限制时,将发出警告,而不是引发异常。

模型注册表错误修复:

  • 如果模型为 SPCS 仅模型且未提供 service_nameModelVersion.run 现在会引发 ValueError

新的预览版功能

  • create_service 方法现在接受布尔实参 autocapture,用于指示是否自动捕获推理数据。

新版本功能

新的模型注册表功能:

  • 新的 snowflake.ml.model.models.huggingface.TransformersPipeline 类旨在替换 snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel,但旧类尚未弃用。新类能识别常见任务的模型签名,因此无需手动指定。目前支持的任务包括:

    • fill-mask

    • question-answering

    • summarization

    • table-question-answering

    • text2text-generation

    • text-classification (别名:sentiment-analysis

    • text-generation

    • token-classification (别名:ner

    • translation

    • translation_xx_to_yy

    • zero-shot-classification (允许您在不将模型加载到内存的情况下记录模型)

  • ``list_services``API 现在显示内部端点,可从另一个 SPCS 节点或笔记本调用,无需 Enterprise Application Integration。它还显示每项服务是否启用了自动捕获。

新 DataConnector 功能:

  • to_huggingface_dataset 方法将 Snowflake 数据转换为 HuggingFace 数据集。支持内存中 Dataset (streaming=False) 和流式 IterableDataset (streaming=True) 模式。

弃用声明

  • snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel 类已弃用,并将在未来版本中移除。

语言: 中文