Skip to content

Instantly share code, notes, and snippets.

@Tob-iee
Created September 13, 2023 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tob-iee/ce42a655887afea8b8fed62364454e16 to your computer and use it in GitHub Desktop.
Save Tob-iee/ce42a655887afea8b8fed62364454e16 to your computer and use it in GitHub Desktop.
custom model folder for the different versions of your model in the Picsellia model registry
model_name = "detr-resnet-50_"
model_description = "Finetuned DETR model"
if 'api_token' not in os.environ:
raise Exception("You must set an api_token to run this image")
api_token = os.environ["api_token"]
if "host" not in os.environ:
host = "https://trial.picsellia.com"
else:
host = os.environ["host"]
if "organization_name " not in os.environ:
organization_name = None
else:
organization_name = os.environ["organization_name"]
client = Client(
api_token=api_token,
host=host,
organization_name=organization_name
)
try:
my_model = client.create_model(
name=model_name,
description=model_description,
)
except:
# Get the model that will receive this new version
my_model = client.get_model(
name=model_name,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment