Model: zenml/finetuned-snowflake-arctic-embed-m
Author: zenml
Pipeline: sentence-similarity
Library: sentence-transformers
Tags: sentence-transformers, safetensors, bert, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:1490, loss:MatryoshkaLoss, loss:TripletLoss, en, arxiv:1908.10084, arxiv:2205.13147, arxiv:1703.07737, base_model:Snowflake/snowflake-arctic-embed-m, base_model:finetune:Snowflake/snowflake-arctic-embed-m, license:apache-2.0, model-index, text-embeddings-inference, endpoints_compatible, region:us
Base models (finetune): id: Snowflake/snowflake-arctic-embed-m
Card metadata: base_model: Snowflake/snowflake-arctic-embed-m
language: en
library_name: sentence-transformers
license: apache-2.0
metrics: cosine_accuracy@1, cosine_accuracy@3, cosine_accuracy@5, cosine_accuracy@10, cosine_precision@1, cosine_precision@3, cosine_precision@5, cosine_precision@10, cosine_recall@1, cosine_recall@3, cosine_recall@5, cosine_recall@10, cosine_ndcg@10, cosine_mrr@10, cosine_map@100
pipeline_tag: sentence-similarity
tags: sentence-transformers, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:1490, loss:MatryoshkaLoss, loss:TripletLoss
widget: source_sentence: Where is the global configuration directory located in ZenML's default setup?
sentences: 'default' ...

Creating default user 'default' ...Creating default stack for user 'default' in workspace default...

Active workspace not set. Setting it to the default.

The active stack is not set. Setting the active stack to the default workspace stack.

Using the default store for the global config.

Unable to find ZenML repository in your current working directory (/tmp/folder) or any parent directories. If you want to use an existing repository which is in a different location, set the environment variable 'ZENML_REPOSITORY_PATH'. If you want to create a new repository, run zenml init.

Running without an active repository root.

Using the default local database.

Running with active workspace: 'default' (global)

┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓

┃ ACTIVE │ STACK NAME │ SHARED │ OWNER   │ ARTIFACT_STORE │ ORCHESTRATOR ┃

┠────────┼────────────┼────────┼─────────┼────────────────┼──────────────┨

┃   👉   │ default    │ ❌     │ default │ default        │ default      ┃

┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛

The following is an example of the layout of the global config directory immediately after initialization:

/home/stefan/.config/zenml   <- Global Config Directory

├── config.yaml              <- Global Configuration Settings

└── local_stores             <- Every Stack component that stores information

|                           locally will have its own subdirectory here.

├── a1a0d3d0-d552-4a80-be09-67e5e29be8ee   <- e.g. Local Store path for the

|                                             `default` local Artifact Store

└── default_zen_store

└── zenml.db         <- SQLite database where ZenML data (stacks,

components, etc) are stored by default.

As shown above, the global config directory stores the following information:, How do you configure the network settings on a Linux server?, Reranking for better retrieval

Add reranking to your RAG inference for better retrieval performance.

Rerankers are a crucial component of retrieval systems that use LLMs. They help improve the quality of the retrieved documents by reordering them based on additional features or scores. In this section, we'll explore how to add a reranker to your RAG inference pipeline in ZenML.

In previous sections, we set up the overall workflow, from data ingestion and preprocessing to embeddings generation and retrieval. We then set up some basic evaluation metrics to assess the performance of our retrieval system. A reranker is a way to squeeze a bit of extra performance out of the system by reordering the retrieved documents based on additional features or scores.

As you can see, reranking is an optional addition we make to what we've already set up. It's not strictly necessary, but it can help improve the relevance and quality of the retrieved documents, which in turn can lead to better responses from the LLM. Let's dive in!

PreviousEvaluation in practice

NextUnderstanding reranking

Last updated 1 month ago, source_sentence: Where can I find the instructions to enable CUDA for GPU-backed hardware in ZenML SDK Docs?
sentences: Migration guide 0.39.1 → 0.41.0

How to migrate your ZenML pipelines and steps from version <=0.39.1 to 0.41.0.

ZenML versions 0.40.0 to 0.41.0 introduced a new and more flexible syntax to define ZenML steps and pipelines. This page contains code samples that show you how to upgrade your steps and pipelines to the new syntax.

Newer versions of ZenML still work with pipelines and steps defined using the old syntax, but the old syntax is deprecated and will be removed in the future.

Overview

from typing import Optional

from zenml.steps import BaseParameters, Output, StepContext, step

from zenml.pipelines import pipeline

# Define a Step

class MyStepParameters(BaseParameters):

param_1: int

param_2: Optional[float] = None

@step

def my_step(

params: MyStepParameters, context: StepContext,

) -> Output(int_output=int, str_output=str):

result = int(params.param_1 * (params.param_2 or 1))

result_uri = context.get_output_artifact_uri()

return result, result_uri

# Run the Step separately

my_step.entrypoint()

# Define a Pipeline

@pipeline

def my_pipeline(my_step):

my_step()

step_instance = my_step(params=MyStepParameters(param_1=17))

pipeline_instance = my_pipeline(my_step=step_instance)

# Configure and run the Pipeline

pipeline_instance.configure(enable_cache=False)

schedule = Schedule(...)

pipeline_instance.run(schedule=schedule)

# Fetch the Pipeline Run

last_run = pipeline_instance.get_runs()[0]

int_output = last_run.get_step["my_step"].outputs["int_output"].read()

from typing import Annotated, Optional, Tuple

from zenml import get_step_context, pipeline, step

from zenml.client import Client

# Define a Step

@step

def my_step(

param_1: int, param_2: Optional[float] = None

) -> Tuple[Annotated[int, "int_output"], Annotated[str, "str_output"]]:

result = int(param_1 * (param_2 or 1))

result_uri = get_step_context().get_output_artifact_uri()

return result, result_uri

# Run the Step separately

my_step()

# Define a Pipeline

@pipeline, How do I integrate Google Cloud VertexAI into my existing Kubernetes cluster?,  SDK Docs .

Enabling CUDA for GPU-backed hardwareNote that if you wish to use this step operator to run steps on a GPU, you will need to follow the instructions on this page to ensure that it works. It requires adding some extra settings customization and is essential to enable CUDA for the GPU to give its full acceleration.

PreviousStep Operators

NextGoogle Cloud VertexAI

Last updated 19 days ago, source_sentence: What are the special metadata types supported by ZenML and how are they used?
sentences: Special Metadata Types

Tracking your metadata.

ZenML supports several special metadata types to capture specific kinds of information. Here are examples of how to use the special types Uri, Path, DType, and StorageSize:

from zenml.metadata.metadata_types import StorageSize, DType

from zenml import log_artifact_metadata

log_artifact_metadata(

metadata={

"dataset_source": Uri("gs://my-bucket/datasets/source.csv"),

"preprocessing_script": Path("/scripts/preprocess.py"),

"column_types": {

"age": DType("int"),

"income": DType("float"),

"score": DType("int")

},

"processed_data_size": StorageSize(2500000)

In this example:

Uri is used to indicate a dataset source URI.

Path is used to specify the filesystem path to a preprocessing script.

DType is used to describe the data types of specific columns.

StorageSize is used to indicate the size of the processed data in bytes.

These special types help standardize the format of metadata and ensure that it is logged in a consistent and interpretable manner.

PreviousGroup metadata

NextFetch metadata within steps

Last updated 19 days ago, Configure a code repository

Connect a Git repository to ZenML to track code changes and collaborate on MLOps projects.

Throughout the lifecycle of a MLOps pipeline, it can get quite tiresome to always wait for a Docker build every time after running a pipeline (even if the local Docker cache is used). However, there is a way to just have one pipeline build and keep reusing it until a change to the pipeline environment is made: by connecting a code repository.

With ZenML, connecting to a Git repository optimizes the Docker build processes. It also has the added bonus of being a better way of managing repository changes and enabling better code collaboration. Here is how the flow changes when running a pipeline:

You trigger a pipeline run on your local machine. ZenML parses the @pipeline function to determine the necessary steps.

The local client requests stack information from the ZenML server, which responds with the cloud stack configuration.

The local client detects that we're using a code repository and requests the information from the git repo.

Instead of building a new Docker image, the client checks if an existing image can be reused based on the current Git commit hash and other environment metadata.

The client initiates a run in the orchestrator, which sets up the execution environment in the cloud, such as a VM.

The orchestrator downloads the code directly from the Git repository and uses the existing Docker image to run the pipeline steps.

Pipeline steps execute, storing artifacts in the cloud-based artifact store.

Throughout the execution, the pipeline run status and metadata are reported back to the ZenML server.

By connecting a Git repository, you avoid redundant builds and make your MLOps processes more efficient. Your team can work on the codebase simultaneously, with ZenML handling the version tracking and ensuring that the correct code version is always used for each run.

Creating a GitHub Repository, Can you explain the process of setting up a virtual environment in Python?, source_sentence: What are the benefits of deploying stack components directly from the ZenML CLI?
sentences: ─────────────────────────────────────────────────┨┃ RESOURCE TYPES   │ 🔵 gcp-generic, 📦 gcs-bucket, 🌀 kubernetes-cluster, 🐳 docker-registry ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ RESOURCE NAME    │ <multiple>                                                               ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ SECRET ID        │ 4694de65-997b-4929-8831-b49d5e067b97                                     ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ SESSION DURATION │ N/A                                                                      ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ EXPIRES IN       │ 59m46s                                                                   ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ OWNER            │ default                                                                  ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ WORKSPACE        │ default                                                                  ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ SHARED           │ ➖                                                                       ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ CREATED_AT       │ 2023-05-19 09:04:33.557126                                               ┃

┠──────────────────┼──────────────────────────────────────────────────────────────────────────┨

┃ UPDATED_AT       │ 2023-05-19 09:04:33.557127                                               ┃

┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Configuration

┏━━━━━━━━━━━━┯━━━━━━━━━━━━┓, How do you set up a custom service account for Vertex AI?, ⚒️Manage stacks

Deploying your stack components directly from the ZenML CLI

The first step in running your pipelines on remote infrastructure is to deploy all the components that you would need, like an MLflow tracking server, a Seldon Core model deployer, and more to your cloud.

This can bring plenty of benefits like scalability, reliability, and collaboration. ZenML eases the path to production by providing a seamless way for all tools to interact with others through the use of abstractions. However, one of the most painful parts of this process, from what we see on our Slack and in general, is the deployment of these stack components.

Deploying and managing MLOps tools is tricky 😭😵‍💫

It is not trivial to set up all the different tools that you might need for your pipeline.

🌈 Each tool comes with a certain set of requirements. For example, a Kubeflow installation will require you to have a Kubernetes cluster, and so would a Seldon Core deployment.

🤔 Figuring out the defaults for infra parameters is not easy. Even if you have identified the backing infra that you need for a stack component, setting up reasonable defaults for parameters like instance size, CPU, memory, etc., needs a lot of experimentation to figure out.

🚧 Many times, standard tool installations don't work out of the box. For example, to run a custom pipeline in Vertex AI, it is not enough to just run an imported pipeline. You might also need a custom service account that is configured to perform tasks like reading secrets from your secret store or talking to other GCP services that your pipeline might need.

🔐 Some tools need an additional layer of installations to enable a more secure, production-grade setup. For example, a standard MLflow tracking server deployment comes without an authentication frontend which might expose all of your tracking data to the world if deployed as-is., source_sentence: What is the expiration time for the GCP OAuth2 token in the ZenML configuration?
sentences: ━━━━━┛

Configuration

┏━━━━━━━━━━━━┯━━━━━━━━━━━━┓┃ PROPERTY   │ VALUE      ┃

┠────────────┼────────────┨

┃ project_id │ zenml-core ┃

┠────────────┼────────────┨

┃ token      │ [HIDDEN]   ┃

┗━━━━━━━━━━━━┷━━━━━━━━━━━━┛

Note the temporary nature of the Service Connector. It will expire and become unusable in 1 hour:

zenml service-connector list --name gcp-oauth2-token

Example Command Output

┏━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━┓

┃ ACTIVE │ NAME             │ ID                                   │ TYPE   │ RESOURCE TYPES        │ RESOURCE NAME │ SHARED │ OWNER   │ EXPIRES IN │ LABELS ┃

┠────────┼──────────────────┼──────────────────────────────────────┼────────┼───────────────────────┼───────────────┼────────┼─────────┼────────────┼────────┨

┃        │ gcp-oauth2-token │ ec4d7d85-c71c-476b-aa76-95bf772c90da │ 🔵 gcp │ 🔵 gcp-generic        │ <multiple>    │ ➖     │ default │ 59m35s     │        ┃

┃        │                  │                                      │        │ 📦 gcs-bucket         │               │        │         │            │        ┃

┃        │                  │                                      │        │ 🌀 kubernetes-cluster │               │        │         │            │        ┃

┃        │                  │                                      │        │ 🐳 docker-registry    │               │        │         │            │        ┃

┗━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━┛

Auto-configuration

The GCP Service Connector allows auto-discovering and fetching credentials and configuration set up by the GCP CLI on your local host., Hugging Face

Deploying models to Huggingface Inference Endpoints with Hugging Face :hugging_face:.

Hugging Face Inference Endpoints provides a secure production solution to easily deploy any transformers, sentence-transformers, and diffusers models on a dedicated and autoscaling infrastructure managed by Hugging Face. An Inference Endpoint is built from a model from the Hub.

This service provides dedicated and autoscaling infrastructure managed by Hugging Face, allowing you to deploy models without dealing with containers and GPUs.

When to use it?

You should use Hugging Face Model Deployer:

if you want to deploy Transformers, Sentence-Transformers, or Diffusion models on dedicated and secure infrastructure.

if you prefer a fully-managed production solution for inference without the need to handle containers and GPUs.

if your goal is to turn your models into production-ready APIs with minimal infrastructure or MLOps involvement

Cost-effectiveness is crucial, and you want to pay only for the raw compute resources you use.

Enterprise security is a priority, and you need to deploy models into secure offline endpoints accessible only via a direct connection to your Virtual Private Cloud (VPCs).

If you are looking for a more easy way to deploy your models locally, you can use the MLflow Model Deployer flavor.

How to deploy it?

The Hugging Face Model Deployer flavor is provided by the Hugging Face ZenML integration, so you need to install it on your local machine to be able to deploy your models. You can do this by running the following command:

zenml integration install huggingface -y

To register the Hugging Face model deployer with ZenML you need to run the following command:

zenml model-deployer register <MODEL_DEPLOYER_NAME> --flavor=huggingface --token=<YOUR_HF_TOKEN> --namespace=<YOUR_HF_NAMESPACE>

Here,

token parameter is the Hugging Face authentication token. It can be managed through Hugging Face settings., Can you list the steps to set up a Docker registry on a Kubernetes cluster?
model-index: name: zenml/finetuned-snowflake-arctic-embed-m
results: task: type: information-retrieval
name: Information Retrieval
dataset: name: dim 384
type: dim_384
metrics: type: cosine_accuracy@1
value: 0.29518072289156627
name: Cosine Accuracy@1
verified: no, type: cosine_accuracy@3
value: 0.5240963855421686
name: Cosine Accuracy@3
verified: no, type: cosine_accuracy@5
value: 0.5843373493975904
name: Cosine Accuracy@5
verified: no, type: cosine_accuracy@10
value: 0.6867469879518072
name: Cosine Accuracy@10
verified: no, type: cosine_precision@1
value: 0.29518072289156627
name: Cosine Precision@1
verified: no, type: cosine_precision@3
value: 0.17469879518072293
name: Cosine Precision@3
verified: no, type: cosine_precision@5
value: 0.11686746987951804
name: Cosine Precision@5
verified: no, type: cosine_precision@10
value: 0.0686746987951807
name: Cosine Precision@10
verified: no, type: cosine_recall@1
value: 0.29518072289156627
name: Cosine Recall@1
verified: no, type: cosine_recall@3
value: 0.5240963855421686
name: Cosine Recall@3
verified: no, type: cosine_recall@5
value: 0.5843373493975904
name: Cosine Recall@5
verified: no, type: cosine_recall@10
value: 0.6867469879518072
name: Cosine Recall@10
verified: no, type: cosine_ndcg@10
value: 0.4908042072911187
name: Cosine Ndcg@10
verified: no, type: cosine_mrr@10
value: 0.42844234079173843
name: Cosine Mrr@10
verified: no, type: cosine_map@100
value: 0.43576329240226386
name: Cosine Map@100
verified: no, task: type: information-retrieval
name: Information Retrieval
dataset: name: dim 256
type: dim_256
metrics: type: cosine_accuracy@1
value: 0.25903614457831325
name: Cosine Accuracy@1
verified: no, type: cosine_accuracy@3
value: 0.5060240963855421
name: Cosine Accuracy@3
verified: no, type: cosine_accuracy@5
value: 0.5783132530120482
name: Cosine Accuracy@5
verified: no, type: cosine_accuracy@10
value: 0.6445783132530121
name: Cosine Accuracy@10
verified: no, type: cosine_precision@1
value: 0.25903614457831325
name: Cosine Precision@1
verified: no, type: cosine_precision@3
value: 0.1686746987951807
name: Cosine Precision@3
verified: no, type: cosine_precision@5
value: 0.11566265060240961
name: Cosine Precision@5
verified: no, type: cosine_precision@10
value: 0.0644578313253012
name: Cosine Precision@10
verified: no, type: cosine_recall@1
value: 0.25903614457831325
name: Cosine Recall@1
verified: no, type: cosine_recall@3
value: 0.5060240963855421
name: Cosine Recall@3
verified: no, type: cosine_recall@5
value: 0.5783132530120482
name: Cosine Recall@5
verified: no, type: cosine_recall@10
value: 0.6445783132530121
name: Cosine Recall@10
verified: no, type: cosine_ndcg@10
value: 0.4548319777111225
name: Cosine Ndcg@10
verified: no, type: cosine_mrr@10
value: 0.39346194301013593
name: Cosine Mrr@10
verified: no, type: cosine_map@100
value: 0.40343211538391555
name: Cosine Map@100
verified: no, task: type: information-retrieval
name: Information Retrieval
dataset: name: dim 128
type: dim_128
metrics: type: cosine_accuracy@1
value: 0.2710843373493976
name: Cosine Accuracy@1
verified: no, type: cosine_accuracy@3
value: 0.46987951807228917
name: Cosine Accuracy@3
verified: no, type: cosine_accuracy@5
value: 0.5662650602409639
name: Cosine Accuracy@5
verified: no, type: cosine_accuracy@10
value: 0.6144578313253012
name: Cosine Accuracy@10
verified: no, type: cosine_precision@1
value: 0.2710843373493976
name: Cosine Precision@1
verified: no, type: cosine_precision@3
value: 0.1566265060240964
name: Cosine Precision@3
verified: no, type: cosine_precision@5
value: 0.11325301204819276
name: Cosine Precision@5
verified: no, type: cosine_precision@10
value: 0.061445783132530116
name: Cosine Precision@10
verified: no, type: cosine_recall@1
value: 0.2710843373493976
name: Cosine Recall@1
verified: no, type: cosine_recall@3
value: 0.46987951807228917
name: Cosine Recall@3
verified: no, type: cosine_recall@5
value: 0.5662650602409639
name: Cosine Recall@5
verified: no, type: cosine_recall@10
value: 0.6144578313253012
name: Cosine Recall@10
verified: no, type: cosine_ndcg@10
value: 0.44433019669319024
name: Cosine Ndcg@10
verified: no, type: cosine_mrr@10
value: 0.3893574297188756
name: Cosine Mrr@10
verified: no, type: cosine_map@100
value: 0.3989315479842741
name: Cosine Map@100
verified: no, task: type: information-retrieval
name: Information Retrieval
dataset: name: dim 64
type: dim_64
metrics: type: cosine_accuracy@1
value: 0.21686746987951808
name: Cosine Accuracy@1
verified: no, type: cosine_accuracy@3
value: 0.42168674698795183
name: Cosine Accuracy@3
verified: no, type: cosine_accuracy@5
value: 0.5180722891566265
name: Cosine Accuracy@5
verified: no, type: cosine_accuracy@10
value: 0.5843373493975904
name: Cosine Accuracy@10
verified: no, type: cosine_precision@1
value: 0.21686746987951808
name: Cosine Precision@1
verified: no, type: cosine_precision@3
value: 0.14056224899598396
name: Cosine Precision@3
verified: no, type: cosine_precision@5
value: 0.10361445783132528
name: Cosine Precision@5
verified: no, type: cosine_precision@10
value: 0.05843373493975902
name: Cosine Precision@10
verified: no, type: cosine_recall@1
value: 0.21686746987951808
name: Cosine Recall@1
verified: no, type: cosine_recall@3
value: 0.42168674698795183
name: Cosine Recall@3
verified: no, type: cosine_recall@5
value: 0.5180722891566265
name: Cosine Recall@5
verified: no, type: cosine_recall@10
value: 0.5843373493975904
name: Cosine Recall@10
verified: no, type: cosine_ndcg@10
value: 0.39639025659520544
name: Cosine Ndcg@10
verified: no, type: cosine_mrr@10
value: 0.3364529546758464
name: Cosine Mrr@10
verified: no, type: cosine_map@100
value: 0.34658882510541217
name: Cosine Map@100
verified: no
Likes: 1 | All-time downloads: 248
Created: 2024-08-05 19:08:54