Weights of mod $p$ automorphic forms