Skip to content

Commit

Permalink
Improve manage by making it more agnostic to call method (#410)
Browse files Browse the repository at this point in the history
* Improve manage by making it more agnostic to call method

* Remove debugger.
  • Loading branch information
Narsil authored Feb 6, 2024
1 parent 7a51428 commit b0fd3dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create_docker(name: str, is_gpu: bool) -> str:
rand = str(uuid.uuid4())[:5]
tag = f"{name}:{rand}"
with cd(
os.path.join(os.path.dirname(os.path.dirname(__file__)), "docker_images", name)
os.path.join(os.path.dirname(os.path.normpath(__file__)), "docker_images", name)
):
subprocess.run(["docker", "build", ".", "-t", tag])
return tag
Expand Down Expand Up @@ -84,12 +84,12 @@ def get_repo_name(model_id: str, dataset_name: str) -> str:

def show(args):
directory = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "docker_images"
os.path.dirname(os.path.normpath(__file__)), "docker_images"
)
for framework in sorted(os.listdir(directory)):
print(f"{framework}")
local_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
os.path.dirname(os.path.normpath(__file__)),
"docker_images",
framework,
"app",
Expand Down Expand Up @@ -151,7 +151,7 @@ def start(args):
model_id, task, framework = resolve_task_framework(args)

local_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "docker_images", framework
os.path.dirname(os.path.normpath(__file__)), "docker_images", framework
)
sys.path.append(local_path)
os.environ["MODEL_ID"] = model_id
Expand Down

0 comments on commit b0fd3dd

Please sign in to comment.