File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/arduino/app_internal/core Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ def infer_from_features(cls, features: list) -> dict | None:
129129 """
130130 try :
131131 url = cls ._get_ei_url ()
132- model_info = cls .get_model_info ()
132+ model_info = cls .get_model_info (url )
133133 features = features [: int (model_info .input_features_count )]
134134
135135 response = requests .post (f"{ url } /api/features" , json = {"features" : features })
@@ -143,16 +143,18 @@ def infer_from_features(cls, features: list) -> dict | None:
143143 return None
144144
145145 @classmethod
146- def get_model_info (cls ) -> EdgeImpulseModelInfo | None :
146+ def get_model_info (cls , url : str = None ) -> EdgeImpulseModelInfo | None :
147147 """Get model information from the Edge Impulse API.
148148
149149 Args:
150150 cls: The class method caller.
151+ url (str): The base URL of the Edge Impulse API. If None, it will be determined automatically.
151152
152153 Returns:
153154 model_info (EdgeImpulseModelInfo | None): An instance of EdgeImpulseModelInfo containing model details, None if an error occurs.
154155 """
155- url = cls ._get_ei_url ()
156+ if not url :
157+ url = cls ._get_ei_url ()
156158
157159 http_client = HttpClient (total_retries = 6 ) # Initialize the HTTP client with retry logic
158160 try :
You can’t perform that action at this time.
0 commit comments