Yeah sir.I confused the softmax with sigmoid but cross entropy actually has softmax.So i think i dont need to use that.Thank you sir.My loss is decreasing now but the prediction is not changing at all.Can you please take a look at it.
Updated model definition
class CharRNN(nn.Module):
  def __init__(self,n_hidden=50,n_layers=2,drop_prob=0.5,vocab_dim=50,emb_size=50,batch_size=64,device="cuda"):
      super().__init__()
      self.drop_prob = drop_prob
      self.n_layers = n_layers
      self.n_hidden = n_hidden
      self.batch_size=batch_size
      self.device=device
      self.embedding=nn.Embedding(vocab_dim,emb_size)
      self.lstm=nn.LSTM(emb_size,n_hidden,n_layers,dropout=self.drop_prob)
      self.linear=nn.Linear(n_hidden,n_hidden)
  

  def init_hidden(self):
        """Set initial hidden states."""
        h0 = torch.zeros(
            self.n_layers,
            self.batch_size,
            self.n_hidden,
        )
        c0 = torch.zeros(
            self.n_layers,
            self.batch_size,
            self.n_hidden,
        )
        
        h0 = h0.to(self.device)
        c0 = c0.to(self.device)

        return h0, c0    


  def apply_rnn(self, embedding_out):
        
        activations, (hn,cn) = self.lstm(embedding_out, self.init_hidden())
        
        return activations

  def forward(self, inputs, return_activations=False):
        self.batch_size = len(inputs)
    
        inputs = torch.LongTensor(inputs).to(self.device)
        inputs=inputs.transpose(0,1)
        
        # Get embeddings
        embedding_out = self.embedding(inputs)
        
        activations = self.apply_rnn(embedding_out)
        
        activations=activations.transpose(0,1) # output shape [batchSize,fixed_length,n_hidden]
        
        activations=self.linear(activations)
        

       return activations    


My model results.It is predicting spaces again and again
epoch #  6	train_loss: 1.05e-01	valid_loss: 1.07e-01



prediction: c                                                   

epoch #  7	train_loss: 1.05e-01	valid_loss: 1.07e-01



prediction:c                                                   

epoch #  8	train_loss: 1.05e-01	valid_loss: 1.07e-01



prediction:c                                                   

epoch #  9	train_loss: 1.05e-01	valid_loss: 1.06e-01



predicition:c                                                   

epoch # 10	train_loss: 1.04e-01	valid_loss: 1.06e-01


Code for printing prediction
def print_re(text):
  
  print(text,end=' ')   #printing first character
  model.eval()          #setting to eval mode
  with torch.no_grad():
        # Forwards pass
        tokens=torch.LongTensor([[char2int[text]]]).to(device)  #coonverting  first char to token
        for i in range(0,50):    #i considered fix len as 50
         
          embeddings=model.embedding(tokens)   #accessing layers through (.) operator.Is it correct?? 
                                                                            #output shape[1,1,emb_len]
          
          hidden_output,(h,c)=model.lstm(embeddings,hiddens) # getting output for that single token
                                                                                                 #output shape[1,1,n_hidden]
                                 
          hidden_output=model.linear(hidden_output)
                                                                                               #output shape[1,1,n_hidden]        
  
          
          hidden_output=hidden_output[0].squeeze(0).squeeze(0)
          
        
          prediction = hidden_output.cpu().numpy()
          
          prediction = np.argmax(prediction, axis=0)
          
          print(int2char[prediction],end='')
          
          tokens=torch.LongTensor([[prediction]]).to(device)

It is printing just spaces for prediction.Try to see if there is any problem sir.Thank you