Skip to content

Commit

Permalink
Update remote api url
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Apr 5, 2024
1 parent 83c6bc5 commit 2fe2693
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ai_models/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _main(argv):
if len(models) == 0:
print(f"No remote models available on {api.url}")
sys.exit(0)
print(f"Models available on remote server {api.url}:")
print(f"Models available on remote server {api.url}")
else:
models = available_models()

Expand Down
5 changes: 4 additions & 1 deletion ai_models/remote/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def __init__(
self.url = (
url or os.getenv("AI_MODELS_REMOTE_URL") or config.get("url") or API_URL
)
if not self.url.endswith("/"):
self.url += "/"

self.token = token or os.getenv("AI_MODELS_REMOTE_TOKEN") or config.get("token")

if not self.token:
Expand Down Expand Up @@ -66,7 +69,7 @@ def run(self, cfg: dict):
# submit task
data = self._request(requests.post, data["href"], json=cfg)

LOG.info("Request submitted")
LOG.info("Inference request submitted")

if data["status"] != "queued":
LOG.error(data["status"])
Expand Down
2 changes: 1 addition & 1 deletion ai_models/remote/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import os

API_URL = "https://ai-models.ecmwf.int"
API_URL = "https://ai-models.ecmwf.int/api/v1/"

ROOT_PATH = os.path.join(os.path.expanduser("~"), ".config", "ai-models")
CONFIG_PATH = os.path.join(ROOT_PATH, "api.yaml")
Expand Down

0 comments on commit 2fe2693

Please sign in to comment.