ConSERT
ConSERT copied to clipboard
Is it possible to run main.py in local machine without GPU?
trafficstars
As titled, thanks!
Since the sentence-transformers library supports training with CPU only, our main.py can also run under the CPU-only setting.
To run without GPU, try:
- Prepare conda virtual environment and install the required libraries:
conda create -n consert-cpuonly python=3.6 # create virtual environment conda install pytorch=1.6 cpuonly # install pytorch-cpu pip install transformers==3.4.0 sentence-transformers==0.3.9 tensorboardX==2.1 pandas==1.1.5 sentencepiece==0.1.85 matplotlib # install other dependencies - Download the data and pre-trained language model (detailed in
README.md) - Run the script as in
README.md, but without--use_apex_ampand--apex_amp_opt_level O1arguments:python3 main.py --no_pair --seed 1 --batch_size 96 --max_seq_length 64 --evaluation_steps 200 --add_cl --cl_loss_only --cl_rate 0.15 --temperature 0.1 --learning_rate 0.0000005 --train_data stssick --num_epochs 10 --da_final_1 feature_cutoff --da_final_2 shuffle --cutoff_rate_final_1 0.2 --model_name_or_path ./bert-base-uncased/ --model_save_path ./output/unsup-base-feature_cutoff-shuffle --force_del --no_dropout --patience 10