Skip to content

Commit

Permalink
fix file path
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Dec 14, 2024
1 parent b785639 commit 5ea457b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions bioimageio_colab/register_sam_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ async def register_service(args: dict) -> None:

if args.ray_address:
# Create runtime environment
base_requirements = parse_requirements("../requirements.txt")
sam_requirements = parse_requirements("../requirements-sam.txt")
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
base_requirements = parse_requirements(
os.path.join(base_dir, "requirements.txt")
)
sam_requirements = parse_requirements(
os.path.join(base_dir, "requirements-sam.txt")
)
runtime_env = {
"pip": base_requirements + sam_requirements,
"py_modules": ["../bioimageio_colab"],
Expand Down Expand Up @@ -253,6 +258,7 @@ def test_model_function(**kwargs: dict):
if __name__ == "__main__":
model_name = "vit_b_lm"
cache_dir = "./model_cache"

embedding = compute_image_embedding(
cache_dir=cache_dir,
model_name=model_name,
Expand All @@ -269,3 +275,14 @@ def test_model_function(**kwargs: dict):
format="kaibu",
context={"user": {"id": "test"}},
)

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
base_requirements = parse_requirements(os.path.join(base_dir, "requirements.txt"))
sam_requirements = parse_requirements(
os.path.join(base_dir, "requirements-sam.txt")
)
runtime_env = {
"pip": base_requirements + sam_requirements,
"py_modules": ["../bioimageio_colab"],
}
print(runtime_env)

0 comments on commit 5ea457b

Please sign in to comment.