Notes

There are multiple choices:

  1. Run on Google Colab:

    1. Connect to GPUs and Mount drive

    2. Clone the repo (with GitHub access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#keeping-your-personal-access-tokens-secure)

    3. Run the train command with the “—cuda” argument. Example:

      ! python train.py \\
        --data data/en-sv/infopankki/prepared \\
        --source-lang sv \\
        --target-lang en \\
        --save-dir assignments/01/baseline/checkpoints \\
        --train-on-tiny \\
        --cuda
      
    4. Be careful about:

      1. Make sure the laptop doesn’t go into sleep mode after some inactive time (because Colab might disconnect then)

      2. There is a trick: https://stackoverflow.com/questions/57113226/how-can-i-prevent-google-colab-from-disconnecting

        1. On Windows, in Colab click on F12 or Fn + F12 to open developer tools, then open the console and enter one of the javascript functions given under the StackOverflow question. For me, this one works:
        function ConnectButton(){
          console.log("Connect pushed");
          document.querySelector("#top-toolbar > colab-connectbutton").shadowRoot.querySelector("#connect").click()
        }
        setInterval(ConnectButton,60000);
        
  2. Run on local:

    1. Install VSCode and Python: https://www.datacamp.com/tutorial/setting-up-vscode-python
    2. Optional: Install WSL
      1. Install WSL on Windows (https://learn.microsoft.com/en-us/windows/wsl/install) and WSL extension on VSCode (https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)
      2. ctr+shift+p to open the VScode command palette, then “WSL: Reopen folder in WSL”
    3. Python Environment:
      1. Option 1 - Installing Conda (recommended):
        1. If you have WSL (see step 2.b):
          1. Install Conda https://gist.github.com/kauffmanes/5e74916617f9993bc3479f401dfec7da
          2. Now we can run the commands on any WSL bash terminal (see the Environment Setup - conda commands)
        2. If you choose not to install WSL:
          1. Install Conda on Windows Powershell: https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html#hash-verification
          2. Then search for “Anaconda prompt” in Windows and we can run the commands under README: Environment Setup - conda on Anaconda prompt.
      2. Option 2: Using virtualenv
        1. If you have WSL (see step 2.b): Run the commands in our README given for the WSL on the wsl terminal
        2. If you choose not to install WSL: Run the commands in our README given for Powershell