3939from sentence_transformers import SentenceTransformer
4040from structures import Document
4141from utils .llm_utils import get_db_conn , get_es_client , split_documents
42- from zenml import ArtifactConfig , log_artifact_metadata , step , log_model_metadata
42+ from zenml import ArtifactConfig , log_metadata , step , log_metadata
4343from zenml .metadata .metadata_types import Uri
4444from zenml .client import Client
4545from constants import SECRET_NAME
@@ -515,8 +515,9 @@ def preprocess_documents(
515515 Exception: If an error occurs during preprocessing.
516516 """
517517 try :
518- log_artifact_metadata (
518+ log_metadata (
519519 artifact_name = "split_chunks" ,
520+ infer_artifact = True ,
520521 metadata = {
521522 "chunk_size" : CHUNK_SIZE ,
522523 "chunk_overlap" : CHUNK_OVERLAP ,
@@ -536,8 +537,9 @@ def preprocess_documents(
536537 histogram_chart : Image .Image = create_histogram (stats )
537538 bar_chart : Image .Image = create_bar_chart (stats )
538539
539- log_artifact_metadata (
540+ log_metadata (
540541 artifact_name = "split_chunks" ,
542+ infer_artifact = True ,
541543 metadata = stats ,
542544 )
543545
@@ -568,8 +570,9 @@ def generate_embeddings(
568570 try :
569571 model = SentenceTransformer (EMBEDDINGS_MODEL )
570572
571- log_artifact_metadata (
573+ log_metadata (
572574 artifact_name = "documents_with_embeddings" ,
575+ infer_artifact = True ,
573576 metadata = {
574577 "embedding_type" : EMBEDDINGS_MODEL ,
575578 "embedding_dimensionality" : EMBEDDING_DIMENSIONALITY ,
@@ -828,7 +831,8 @@ def _log_metadata(index_type: IndexType) -> None:
828831 "dbname" : "postgres" ,
829832 }
830833
831- log_model_metadata (
834+ log_metadata (
835+ infer_model = True ,
832836 metadata = {
833837 "embeddings" : {
834838 "model" : EMBEDDINGS_MODEL ,
0 commit comments