There is a bug in your code. The batch and training input does not match.
skip_window = 1 # How many words to consider left and right.
num_skips = 2
batch = np.ndarray(shape=(batch_size, num_skips), dtype=np.int32)
train_inputs = tf.placeholder(tf.int32,shape=[batch_size, skip_window * 2])
batch_temp = np.ndarray(shape=(num_skips), dtype=np.int32)
currently it is working because the skip_window is 1 and num_skip is 2. when you change either of them it starts to crack.
I suppose the fix is to change it to skip_window but I am not sure.