Created
September 13, 2023 14:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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