Spaces:
Runtime error
Runtime error
File size: 544 Bytes
a22e84b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from pathlib import Path
from zenml import pipeline
from zenml.client import Client
from steps import export as export_steps
@pipeline
def export_artifact_to_json(artifact_names: list[str], output_dir: Path = Path("output")) -> None:
for artifact_name in artifact_names:
artifact = Client().get_artifact_version(name_id_or_prefix=artifact_name)
data = export_steps.serialize_artifact(artifact=artifact, artifact_name=artifact_name)
export_steps.to_json(data=data, to_file=output_dir / f"{artifact_name}.json")
|