I am using the torch.jit.ScriptModule too. Mine is like that:
class NER(torch.jit.ScriptModule):
 
      __constants__ = ['rnn_outdim', 'one_direction_dim', 'add_proj']
      def __init__(self, rnn,
                  w_num: int,
                  w_dim: int,
                  c_num: int,
                  c_dim: int,
                  y_dim: int,
                  y_num: int,
                  droprate: float):
  
          super(NER, self).__init__()
  
          ...
  
          if self.add_proj:
          ...
              self.chunk_layer = nn.Sequential(self.to_chunk, self.drop, self.to_chunk_proj, self.drop, self.chunk_weight)
              self.type_layer = nn.Sequential(self.to_type, self.drop, self.to_type_proj, self.drop, self.type_weight)
          else:
              ...
              self.chunk_layer = nn.Sequential(self.to_chunk, self.drop, self.chunk_weight)
              self.type_layer = nn.Sequential(self.to_type, self.drop, self.type_weight)