Skip to content

Instantly share code, notes, and snippets.

@WillEngler
Created March 22, 2024 19:46
Show Gist options
  • Save WillEngler/405849e68830fe00822b56b79cbc737e to your computer and use it in GitHub Desktop.
Save WillEngler/405849e68830fe00822b56b79cbc737e to your computer and use it in GitHub Desktop.
from garden_ai.mlmodel import ModelMetadata, DatasetConnection
from garden_ai import local_data
dc1 = DatasetConnection(
title="Benchmark Dataset for Locating Atoms in STEM images",
doi="10.18126/e73h-3w6n",
url="https://foundry-ml.org/#/datasets/10.18126%2Fe73h-3w6n",
repository="Foundry",
)
dc2 = DatasetConnection(
title="Training Dataset for Locating Atoms in STEM images",
doi="10.18126/qsdl-aj6x",
url="https://foundry-ml.org/#/datasets/10.18126%2Fqsdl-aj6x",
repository="Foundry",
)
just_one = ModelMetadata(
model_identifier="Atom Position Finder",
model_repository="GitHub",
model_version="1.0",
datasets=[dc1]
)
both = ModelMetadata(
model_identifier="Atom Position Finder",
model_repository="GitHub",
model_version="1.0",
datasets=[dc1, dc2]
)
need_one = ["10.26311/8s9h-dz64", "10.26311/bf7a-7071"]
need_both = ["10.26311/e2mw-qf63", "10.26311/b6zb-ns88", "10.26311/q6e2-2p11", "10.26311/bkk2-gc19", "10.26311/k2bk-hw50", "10.26311/bgb7-k519", "10.26311/x13g-7f17", "10.26311/s8hf-3v65"]
for doi in need_one:
ep = local_data.get_local_entrypoint_by_doi(doi)
ep.models.clear()
ep.models.append(just_one)
local_data.put_local_entrypoint(ep)
for doi in need_both:
ep = local_data.get_local_entrypoint_by_doi(doi)
ep.models.clear()
ep.models.append(both)
local_data.put_local_entrypoint(ep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment