If you are running the code directly from that page, you may have a cut and paste error.  I just cut and pasted it directly and ran it, and it worked.
I can help with your first error:

RuntimeError: Expected hidden size (2, 10, 100), got (1, 10, 100)

It is a little misleading to say that all you need to do is set the bi-directional flag to be True.  That is all that is necessary for the nn.LSTM(…) object to set itself up correctly, but it is not all that needs to happen to get your code to run correctly.
Specifically, a bi-directional RNN is very much like a pair of 1-directional RNNs running in parallel with their outputs jammed together at the end.  Each of those RNNs need their own hidden and cell states.  In PyTorch, the way to do that is to change the shape of the tensors holding the hidden and cell states.  This is what the error message was telling you:

RuntimeError: Expected hidden size (2, 10, 100), got (1, 10, 100)

Note the change from 1 to 2.  Somewhere in your original code, you were defining the initial hidden and cell states.  Find those definitions and change them as the error message suggests.
Depending on what your code looked like, there may be other changes necessary.