-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* data transfer from local to modal * Update readme.md * Update readme.md * minor changes * removed old file * added a script to upload a floor from local * Update readme.md * updated the volume name
- Loading branch information
Showing
3 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import modal | ||
import os | ||
import logging | ||
|
||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | ||
|
||
volume = modal.Volume.from_name("NewVisiondata", create_if_missing=True) | ||
|
||
|
||
def process_upload(remote_path, folder_path): | ||
with volume.batch_upload() as batch: | ||
try: | ||
batch.put_directory(folder_path, remote_path) | ||
logging.info(f"Successfully uploaded '{folder_path}' to '{remote_path}' in the Modal volume.") | ||
except Exception as e: | ||
logging.error(f"Failed to upload '{folder_path}' to '{remote_path}': {e}") | ||
|
||
if __name__ == "__main__": | ||
import sys | ||
|
||
if len(sys.argv) != 5: | ||
print("Usage: python script_name.py <place> <building> <floor> <local folder path>") | ||
sys.exit(1) | ||
|
||
arg1, arg2, arg3, folder_path = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4] | ||
remote_path = os.path.join("data",arg1, arg2, arg3) | ||
|
||
process_upload(remote_path, folder_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## upload from local to modal | ||
- refer this file ``` src/modal_functions/add_new_map.py``` | ||
- submit the parameters while executing | ||
``` | ||
python add_new_map.py <place> <building> <floor> <local_folder_path> | ||
``` | ||
- Example | ||
``` | ||
python add_new_map.py New_york_city nyc_hospital 17_floor_dog home/users/user1/.....( folder path that contain all the files for mentioned place, building, floor) | ||
``` | ||