{"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 = \"179_gru_minute_embedding_sync\"\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-02T09:54:29.854172Z","iopub.execute_input":"2023-12-02T09:54:29.855352Z","iopub.status.idle":"2023-12-02T09:54:43.064273Z","shell.execute_reply.started":"2023-12-02T09:54:29.855309Z","shell.execute_reply":"2023-12-02T09:54:43.063205Z"},"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-02T09:54:43.066169Z","iopub.execute_input":"2023-12-02T09:54:43.066715Z","iopub.status.idle":"2023-12-02T09:54:43.073135Z","shell.execute_reply.started":"2023-12-02T09:54:43.066681Z","shell.execute_reply":"2023-12-02T09:54:43.071713Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}