-
Make sure you have Miniconda installed
- Conda is a package manager that sandboxes your project’s dependencies in a virtual environment
- Miniconda contains Conda and its dependencies with no extra packages by default (as opposed to Anaconda, which installs some extra packages)
-
cd into src, run
conda env create -f environment.yml
- This creates a Conda environment called
squad
- This creates a Conda environment called
-
Run
source activate squad
- This activates the
squad
environment - Do this each time you want to write/test your code
- This activates the
-
Run
python setup.py
- This downloads SQuAD 2.0 training and dev sets, as well as the GloVe 300-dimensional word vectors (840B)
- This also pre-processes the dataset for efficient data loading
- For a MacBook Pro on the Stanford network,
setup.py
takes around 30 minutes total
-
Browse the code in
train.py
0. Prior to running thetrain.py
script, please type in your consoleexport CUDA_VISIBLE_DEVICES=0
and check that only one GPU is visible:echo $CUDA_VISIBLE_DEVICES
. This is required as multi-GPU creates issues with the code.- The
train.py
script is the entry point for training a model. It reads command-line arguments, loads the SQuAD dataset, and trains a model. - You may find it helpful to browse the arguments provided by the starter code. Either look directly at the
parser.add_argument
lines in the source code, or runpython train.py -h
. - To train the baseline, use
python train.py --model bidaf --name baseline --num_workers 0
- To train the bidafextra model, use
python train.py --model bidafextra --name bidafextra --num_workers 0
- To train the FusionNet model, use
python train.py --model fusionnet --name fusionnet --num_workers 0
- The
-
To generate the file required to be uploaded to the leaderboard, it is necessary to use the following command:
python test.py --split dev --name fusionnet --num_workers=0 --batch_size=64 --model fusionnet --load_path ./save/train/fusionnet-03/best.pth.tar
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
CS224n SQUAD 2.0 Final Project using non PCE methods
License
SebastianHurubaru/cs224n_squad_2
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
CS224n SQUAD 2.0 Final Project using non PCE methods
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published