因为算力问题,13b的训练中止了一段时间,虽然不知道13b的最终效果怎么样,但是我们打算租一张卡跑一下训练,然后根据效果看看是否要用13b
经过多方比较后,我们打算在autodl上面租服务器,选择了一张L20,目前来看应该是可以符合我们的训练要求的算力要求的。
配置环境
根据emvironment.yml提供的环境进行配置
name: drugchat
channels:
- pytorch
- defaults
- anaconda
dependencies:
- python=3.9
- cudatoolkit
- pip
- pytorch=1.12.1
- pytorch-mutex=1.0=cuda
- torchaudio=0.12.1
- torchvision=0.13.1
- pip:
- accelerate==0.16.0
- aiohttp==3.8.4
- aiosignal==1.3.1
- async-timeout==4.0.2
- attrs==22.2.0
- bitsandbytes==0.37.0
- cchardet==2.1.7
- chardet==5.1.0
- contourpy==1.0.7
- cycler==0.11.0
- filelock==3.9.0
- fonttools==4.38.0
- frozenlist==1.3.3
- huggingface-hub==0.13.4
- importlib-resources==5.12.0
- Jinja2==3.1.2
- kiwisolver==1.4.4
- matplotlib==3.7.0
- multidict==6.0.4
- openai==0.27.0
- packaging==23.0
- psutil==5.9.4
- pycocotools==2.0.6
- pyparsing==3.0.9
- python-dateutil==2.8.2
- pyyaml==6.0
- regex==2022.10.31
- tokenizers==0.13.2
- tqdm==4.64.1
- transformers==4.28.0
- timm==0.6.13
- spacy==3.5.1
- webdataset==0.2.48
- scikit-learn==1.2.2
- scipy==1.10.1
- yarl==1.8.2
- zipp==3.14.0
- omegaconf==2.3.0
- opencv-python==4.7.0.72
- iopath==0.1.10
- decord==0.6.0
- tenacity==8.2.2
- peft
- pycocoevalcap
- sentence-transformers
- umap-learn
- notebook
- gradio==3.24.1
- gradio-client==0.0.8
- wandb
配置过程比较艰辛(略)
配置完成以后向服务器上部署项目
部署完后项目的结构如下
(base) root@autodl-container-29af4197c9-f50882df:~/autodl-tmp# tree drugchat
drugchat
├── app
│ ├── __init__.py
│ ├── _pycache_
│ │ └── __init__.cpython-39.pyc
│ └── chat.py
├── chat.py
├── ckpt
│ ├── gcn_contextpred.pth
│ ├── with_gnn_node_feat.pth
│ ├── with_gnn_node_feat2.pth
│ └── with_gnn_node_feat3.pth
├── data
│ ├── ChEMBL_QA.json
│ ├── ChEMBL_QA_test.json
│ ├── ChEMBL_QA_train.json
│ ├── PubChem_Desc.json
│ └── PubChem_QA.json
├── dataset
│ ├── chembl_pyg_abs3.pkl
│ ├── combine_convert_datasets.py
│ ├── convert_chebi.py
│ ├── convert_chebi2.py
│ ├── dataset
│ │ ├── PubChem_QA_train.pkl
│ │ ├── chembl_QA_train.pkl
│ │ └── chembl_pubchem_train.pkl
│ ├── smiles2graph.py
│ ├── smiles2graph_demo.py
│ ├── tmp_smiles.pkl
│ └── tmp_smiles.txt
├── demo.py
├── demo.sh
├── dependencies
│ ├── pyg_lib-0.4.0+pt22cu121-cp39-cp39-linux_x86_64.whl
│ ├── torch_cluster-1.6.3+pt22cu121-cp39-cp39-linux_x86_64.whl
│ ├── torch_scatter-2.1.2+pt22cu121-cp39-cp39-linux_x86_64.whl
│ ├── torch_sparse-0.6.18+pt22cu121-cp39-cp39-linux_x86_64.whl
│ └── torch_spline_conv-1.2.2+pt22cu121-cp39-cp39-linux_x86_64.whl
├── environment.yml
├── eval_configs
│ ├── drugchat_eval.yaml
│ └── drugchat_infer.yaml
├── finetune_gnn.sh
├── inference.py
├── inference.sh
├── pipeline
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-39.pyc
│ ├── common
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ ├── config.cpython-39.pyc
│ │ │ ├── dist_utils.cpython-39.pyc
│ │ │ ├── logger.cpython-39.pyc
│ │ │ ├── optims.cpython-39.pyc
│ │ │ ├── registry.cpython-39.pyc
│ │ │ └── utils.cpython-39.pyc
│ │ ├── config.py
│ │ ├── dist_utils.py
│ │ ├── logger.py
│ │ ├── optims.py
│ │ ├── registry.py
│ │ └── utils.py
│ ├── configs
│ │ ├── datasets
│ │ │ ├── cc_sbu
│ │ │ │ ├── align.yaml
│ │ │ │ └── defaults.yaml
│ │ │ ├── gnn
│ │ │ │ └── pretrain.yaml
│ │ │ └── laion
│ │ │ └── defaults.yaml
│ │ ├── default.yaml
│ │ └── models
│ │ ├── drugchat.yaml
│ │ └── gnn.yaml
│ ├── conversation
│ │ ├── __init__.py
│ │ └── conversation.py
│ ├── datasets
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ └── data_utils.cpython-39.pyc
│ │ ├── builders
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-39.pyc
│ │ │ │ ├── base_dataset_builder.cpython-39.pyc
│ │ │ │ ├── gnn_pretrain_builder.cpython-39.pyc
│ │ │ │ └── image_text_pair_builder.cpython-39.pyc
│ │ │ ├── base_dataset_builder.py
│ │ │ ├── gnn_pretrain_builder.py
│ │ │ └── image_text_pair_builder.py
│ │ ├── data_utils.py
│ │ └── datasets
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ ├── base_dataset.cpython-39.pyc
│ │ │ ├── caption_datasets.cpython-39.pyc
│ │ │ ├── cc_sbu_dataset.cpython-39.pyc
│ │ │ ├── dataloader_utils.cpython-39.pyc
│ │ │ ├── graph_word_vec_dataset.cpython-39.pyc
│ │ │ └── laion_dataset.cpython-39.pyc
│ │ ├── base_dataset.py
│ │ ├── caption_datasets.py
│ │ ├── cc_sbu_dataset.py
│ │ ├── dataloader_utils.py
│ │ ├── graph_word_vec_dataset.py
│ │ └── laion_dataset.py
│ ├── models
│ │ ├── Qformer.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── Qformer.cpython-39.pyc
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ ├── base_model.cpython-39.pyc
│ │ │ ├── blip2.cpython-39.pyc
│ │ │ ├── eva_vit.cpython-39.pyc
│ │ │ ├── gnn.cpython-39.pyc
│ │ │ ├── gnn_pretrain.cpython-39.pyc
│ │ │ ├── mini_gpt4.cpython-39.pyc
│ │ │ └── modeling_llama.cpython-39.pyc
│ │ ├── base_model.py
│ │ ├── blip2.py
│ │ ├── blip2_outputs.py
│ │ ├── eva_vit.py
│ │ ├── gnn.py
│ │ ├── gnn_pretrain.py
│ │ ├── mini_gpt4.py
│ │ └── modeling_llama.py
│ ├── output
│ │ └── pipeline_stage2_finetune
│ │ └── 20240530133
│ │ ├── log.txt
│ │ └── result
│ ├── processors
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ ├── base_processor.cpython-39.pyc
│ │ │ ├── blip_processors.cpython-39.pyc
│ │ │ └── randaugment.cpython-39.pyc
│ │ ├── base_processor.py
│ │ ├── blip_processors.py
│ │ └── randaugment.py
│ ├── runners
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ └── runner_base.cpython-39.pyc
│ │ └── runner_base.py
│ └── tasks
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-39.pyc
│ │ ├── base_task.cpython-39.pyc
│ │ ├── gnn_pretrain.cpython-39.pyc
│ │ └── image_text_pretrain.cpython-39.pyc
│ ├── base_task.py
│ ├── gnn_pretrain.py
│ └── image_text_pretrain.py
├── pretrain_gnn.sh
├── prompts
│ └── alignment.txt
├── train.py
├── train_configs
│ ├── drugchat_gnn_pretrain.yaml
│ ├── drugchat_stage1_pretrain.yaml
│ └── drugchat_stage2_finetune.yaml
└── vicuna
└── vicuna-13b-weight-save
├── config.json
├── generation_config.json
├── model-00001-of-00006.safetensors
├── model-00002-of-00006.safetensors
├── model-00003-of-00006.safetensors
├── model-00004-of-00006.safetensors
├── model-00005-of-00006.safetensors
├── model-00006-of-00006.safetensors
├── model.safetensors.index.json
├── special_tokens_map.json
├── tokenizer.model
└── tokenizer_config.json41 directories, 146 files
把vicuna-13b的weight放在yml里面,开始训练:
bash finetune_gnn.sh
跑的也不快,一个epoch大概需要六个小时作用,看看跑出来的效果如何吧