General Usage
Prerequisites:
Install and Confure Istari Digital SDK:
Follow this link for How to: istari-digital-client Installation
Example: Upload a model to the Istari platform
Upload a file as a model
model = client.add_model(
path="path/to/model/file",
description="My model",
version_name="v1.0"
)
print(f"Uploaded base model with ID {model.id}")
Example: List and download model artifacts
Download the latest artifacts for a specified model
model = client.get_model(model_id)
for artifact in model.artifacts:
print(f"- artifact id: {artifact.id}")
print(f" revision id: {artifact.revision.id}")
print(f" extension: {artifact.extension}")
print(f" mime type: {artifact.mime}")
print(f" name: {artifact.name}")
output_file_path = f"c:\\extracts\\{artifact.name}"
if artifact.extension in ["txt", "csv", "md", "json", "html", "obj"]:
with open(output_file_path, "w") as f:
f.write(artifact.read_text())
else:
with open(output_file_path, "wb") as f:
f.write(artifact.read_bytes())