From b5dd5b5e9c88acebe42d9342d1afbcd80a30ef2c Mon Sep 17 00:00:00 2001 From: almaz Date: Wed, 19 Jun 2024 15:57:03 +0200 Subject: [PATCH] fix remove paths --- _legacy/visualize_embeddings/src/main.py | 3 ++- src/main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/_legacy/visualize_embeddings/src/main.py b/_legacy/visualize_embeddings/src/main.py index 2d38ddb..5c29781 100644 --- a/_legacy/visualize_embeddings/src/main.py +++ b/_legacy/visualize_embeddings/src/main.py @@ -100,7 +100,8 @@ def calculate_projections(projection_method, metric="euclidean", umap_min_dist=0 ) torch.save(projections, save_paths["projections"]) print("uploading projections to team_files...") - api.file.upload(team_id, save_paths["projections"], save_paths["projections"]) + remote_path = f"/{save_paths['projections']}" + api.file.upload(team_id, save_paths["projections"], remote_path) obj_classes = list(set(all_info["object_cls"])) diff --git a/src/main.py b/src/main.py index cbf6eb4..cfbced9 100644 --- a/src/main.py +++ b/src/main.py @@ -359,7 +359,8 @@ def run(): projections = run_utils.calculate_projections(embeddings, all_info_list, projection_method, metric=metric) print("uploading projections to team_files...") torch.save(projections, save_paths["projections"]) - api.file.upload(team_id, save_paths["projections"], save_paths["projections"]) + remote_path = f"/{save_paths['projections']}" + api.file.upload(team_id, save_paths["projections"], remote_path) file_id = str(api.file.get_info_by_path(team_id, "/" + save_paths["embeddings"]).id) server_address = os.environ.get("SERVER_ADDRESS") if server_address: