{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":53666,"databundleVersionId":6589269,"sourceType":"competition"}],"dockerImageVersionId":30558,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"from pathlib import Path\n\nfrom google.cloud import storage\n\nproject_name = \"dena-ai-training-39-gcp\"\nbucket_name = \"kaggle_cmi\"\nrun_name = \"163_gru_sleep_target\"\n\nclient = storage.Client(project_name)\nbucket = client.get_bucket(bucket_name)\n\nfor file in [f\"{run_name}.py\", \"log.txt\"]:\n    blob = bucket.blob(f\"sakami/artifacts/{run_name}/{file}\")\n    blob.download_to_filename(filename=file)\n\n# model weights\nmodel_dir = Path(\"models/\")\nmodel_dir.mkdir(exist_ok=True)\nfor blob in bucket.list_blobs(prefix=f\"sakami/artifacts/{run_name}/checkpoint/models/\"):\n    file_name = Path(blob.name).name\n    blob.download_to_filename(filename=str(model_dir / file_name))\n\nprint([str(path) for path in Path(\".\").iterdir() if not str(path).startswith(\".\")])\nprint([str(path) for path in model_dir.iterdir() if not str(path).startswith(\".\")])","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-12-02T08:13:11.651536Z","iopub.execute_input":"2023-12-02T08:13:11.651923Z","iopub.status.idle":"2023-12-02T08:13:25.845764Z","shell.execute_reply.started":"2023-12-02T08:13:11.651889Z","shell.execute_reply":"2023-12-02T08:13:25.844222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"with open(\"log.txt\") as f:\n    print(f.read())","metadata":{"execution":{"iopub.status.busy":"2023-12-02T08:13:25.848474Z","iopub.execute_input":"2023-12-02T08:13:25.849068Z","iopub.status.idle":"2023-12-02T08:13:25.854395Z","shell.execute_reply.started":"2023-12-02T08:13:25.849034Z","shell.execute_reply":"2023-12-02T08:13:25.853659Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}