From be4c73a42717a2f0382d60f6adbf81015b95e9ed Mon Sep 17 00:00:00 2001 From: Giuseppe Ambrosio Date: Tue, 10 Dec 2024 10:04:52 +0100 Subject: [PATCH] feat(remote-model): metadata update --- focoos/remote_model.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/focoos/remote_model.py b/focoos/remote_model.py index 7ccb337..ad5c9a7 100644 --- a/focoos/remote_model.py +++ b/focoos/remote_model.py @@ -39,12 +39,11 @@ def __init__(self, model_ref: str, http_client: HttpClient): def get_info(self) -> ModelMetadata: res = self.http_client.get(f"models/{self.model_ref}") - self.metadata = ModelMetadata(**res.json()) - if res.status_code == 200: - return self.metadata - else: + if res.status_code != 200: logger.error(f"Failed to get model info: {res.status_code} {res.text}") raise ValueError(f"Failed to get model info: {res.status_code} {res.text}") + self.metadata = ModelMetadata(**res.json()) + return self.metadata def train( self,