Skip to content

Commit

Permalink
Add dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EhsanMashhadi committed Mar 30, 2021
1 parent d26acc2 commit f8fda9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ data folder contains multiple folders and files:
- use current path as `pretrained_model` variable in script files
2. Clone the repository
- git clone https://github.com/EhsanMashhadi/MSR2021-ProgramRepair.git
3. Train the model with MSR data
3. Install dependencies
- pip install torch==1.4.0
- pip install transformers==2.5.0
4. Train the model with MSR data
- bash ./scripts/codebert/train.sh
4. Evaluate the model
5. Evaluate the model
- bash ./scripts/codebert/test.sh

### Running Simple LSTM Experiments
Expand Down
3 changes: 2 additions & 1 deletion scripts/codebert/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ test_file=$data_dir/src-test.txt,$data_dir/tgt-test.txt
test_model=$output_dir/checkpoint-best-ppl/pytorch_model.bin
pretrained_model=./code-bert #CodeBert model path downloaded from Huggingface
pretrained_model=../../codebert-model/codebert-base
CodeBERT=../../codebert

python ../codebert/run.py \
python $CodeBERT/run.py \
--do_test \
--model_type roberta \
--model_name_or_path $pretrained_model \
Expand Down
4 changes: 3 additions & 1 deletion scripts/codebert/train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ train_file=$data_dir/src-train.txt,$data_dir/tgt-train.txt
validate_file=$data_dir/src-val.txt,$data_dir/tgt-val.txt
pretrained_model=./code-bert #CodeBert model path downloaded from Huggingface
pretrained_model=../../codebert-model/codebert-base
CodeBERT=../../codebert

python ../codebert/run.py \

python $CodeBERT/run.py \
--do_train \
--do_eval \
--model_type roberta \
Expand Down

0 comments on commit f8fda9d

Please sign in to comment.