{"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"},{"sourceId":7074022,"sourceType":"datasetVersion","datasetId":4074285}],"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 = \"156_gru_transformer_residual\"\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-11-28T12:36:16.525247Z","iopub.execute_input":"2023-11-28T12:36:16.526133Z","iopub.status.idle":"2023-11-28T12:36:26.939652Z","shell.execute_reply.started":"2023-11-28T12:36:16.526095Z","shell.execute_reply":"2023-11-28T12:36:26.938051Z"},"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-11-28T12:36:26.941250Z","iopub.execute_input":"2023-11-28T12:36:26.941708Z","iopub.status.idle":"2023-11-28T12:36:26.946455Z","shell.execute_reply.started":"2023-11-28T12:36:26.941681Z","shell.execute_reply":"2023-11-28T12:36:26.945363Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cp -r /kaggle/input/longformer-config/longformer-base-4096 .","metadata":{"execution":{"iopub.status.busy":"2023-11-28T12:47:09.843446Z","iopub.execute_input":"2023-11-28T12:47:09.843795Z","iopub.status.idle":"2023-11-28T12:47:10.190359Z","shell.execute_reply.started":"2023-11-28T12:47:09.843769Z","shell.execute_reply":"2023-11-28T12:47:10.188681Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls","metadata":{"execution":{"iopub.status.busy":"2023-11-28T12:47:14.637909Z","iopub.execute_input":"2023-11-28T12:47:14.638323Z","iopub.status.idle":"2023-11-28T12:47:14.971088Z","shell.execute_reply.started":"2023-11-28T12:47:14.638293Z","shell.execute_reply":"2023-11-28T12:47:14.969870Z"},"trusted":true},"execution_count":null,"outputs":[]}]}