Skip to content

Commit

Permalink
fix path joining
Browse files Browse the repository at this point in the history
  • Loading branch information
gabewillen committed Feb 6, 2025
1 parent dda45a9 commit 275dce4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from dotenv import load_dotenv
from functools import cached_property
from runpod import RunPodLogger
from urllib.parse import urljoin

logger = RunPodLogger()

Expand All @@ -12,7 +13,7 @@
# how many items can be in the queue
os.environ["INFINITY_QUEUE_SIZE"] = "48000"

MODEL_CACHE_PATH_TEMPLATE = "/runpod/cache/{model}/{revision}"
MODEL_CACHE_PATH_TEMPLATE = "/runpod/cache/{path}"

CONFIG_MESSAGE_TEMPLATE = "{message} [see https://github.com/runpod-workers/worker-infinity-embedding for more information]"

Expand Down Expand Up @@ -48,10 +49,9 @@ def model_names(self) -> list[str]:
MODEL_CACHE_PATH_TEMPLATE.format(
# the model is always the first element
model=repository_and_revision[0],
# the revision is the second element if it exists
revision=repository_and_revision[1]
path=urljoin(repository_and_revision[0], repository_and_revision[1])
if len(repository_and_revision) > 1
else "main",
else repository_and_revision[0],
)
# the repository is split into the model and revision by the last colon
for repository_and_revision in (
Expand Down

0 comments on commit 275dce4

Please sign in to comment.