From eeba3c761ec489e28d7e9a4ef89822e1d100abc2 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 31 Oct 2023 18:37:53 +0100 Subject: [PATCH 1/2] Update default API key parameter for get_roboflow_model function `ROBOFLOW_API_KEY` is used by default when `get_roboflow_model` is being called. --- inference/models/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inference/models/utils.py b/inference/models/utils.py index 1bc09d019..177a71a5e 100644 --- a/inference/models/utils.py +++ b/inference/models/utils.py @@ -10,6 +10,7 @@ YOLOv8ObjectDetection, ) from inference.models.yolov8.yolov8_keypoints_detection import YOLOv8KeypointsDetection +from inference.core.env import API_KEY ROBOFLOW_MODEL_TYPES = { ("classification", "vit"): VitClassification, @@ -149,6 +150,6 @@ pass -def get_roboflow_model(model_id, api_key=None, **kwargs): +def get_roboflow_model(model_id, api_key=API_KEY, **kwargs): task, model = get_model_type(model_id, api_key=api_key) return ROBOFLOW_MODEL_TYPES[(task, model)](model_id, api_key=api_key, **kwargs) From 8acd08dfa7a95803555e9462efe94d18f57250b6 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 31 Oct 2023 18:43:10 +0100 Subject: [PATCH 2/2] Make `black` happy --- inference/models/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inference/models/utils.py b/inference/models/utils.py index 177a71a5e..542d316e0 100644 --- a/inference/models/utils.py +++ b/inference/models/utils.py @@ -1,3 +1,4 @@ +from inference.core.env import API_KEY from inference.core.registries.roboflow import get_model_type from inference.models import ( YOLACT, @@ -10,7 +11,6 @@ YOLOv8ObjectDetection, ) from inference.models.yolov8.yolov8_keypoints_detection import YOLOv8KeypointsDetection -from inference.core.env import API_KEY ROBOFLOW_MODEL_TYPES = { ("classification", "vit"): VitClassification,