In what program/interface do I run the following code?

29 views Asked by At

For a project on machine learning/NLP I am looking at some code from github on roBERTa. I wanted to see if I could get the same results and then modify the program to fit my own data.

However, I have no idea on how/where/using what program to run the following code:

export COMVE_DIR=/path/to/COMVE_data_dir 
export OUTPUT_DIR=/path/to/output_dir 
python3 ./run_taskB.py \
  --model_type bert \
  --task_name swag \
  --model_name_or_path bert-base-uncased\
  --do_train \
  --do_eval \
  --do_test \
  --data_dir $COMVE_DIR \
  --learning_rate 5e-5 \
  --num_train_epochs 3 \
  --max_seq_length 80 \
  --output_dir $OUTPUT_DIR \
  --per_gpu_eval_batch_size=8 \
  --per_gpu_train_batch_size=8 \
  --gradient_accumulation_steps 2 \
  --overwrite_output > results.csv

I have tried multiple programs / terminal / jupyter but can't seem to find out how to run this code properly. Does anybody know how to run it? (I understand I have to change the directories in the first lines etc, but only getting errors right now.)

1

There are 1 answers

0
tripleee On

This looks like Bash code, but in isolation it probably won't do very much. It requires that you have Python 3 and a number of libraries installed.

But if you have already satisfied the prerequisites, try this at a bash$ prompt near you, in the directory where you have the file run_taskB.py