Sir i don’t think it can overfit to space bcz for every few chars there will be a single space.So i think it is not a possibility
Sir replacing torch.zeros with torch.randn really helps in prediction.SO it is one of the soution
But i tried various ones.Results are below.I saw your linkedin and your career is so good so i assume you are busy.So Thank you for answering to my queries.
Sir i did it with batch size 1 and 15 chars and it converged to 0 loss. The prediction is also good.

After that I tried with batch size 32 and results are again bad.
So this time i tried with 1000 chars and batch size 1 whose length is 30 by removing spaces and results are as follows:
ch #285	train_loss: 8.89e-02	valid_loss: 0.00e+00


predicted_text=cdtmseteseeetehhnaelcibeaeaelce
epoch #286	train_loss: 7.01e-02	valid_loss: 0.00e+00


cieaeteelmteeh,wWshselueaeeeshs
epoch #287	train_loss: 5.59e-02	valid_loss: 0.00e+00


celceSeaehshhshh,tmteshslowhsee
epoch #288	train_loss: 5.67e-02	valid_loss: 0.00e+00


celyslueteaeteshnaesewlueseelse
epoch #289	train_loss: 4.86e-02	valid_loss: 0.00e+00

It didn’t converged to 0.but predicted text is TEXT not repeating a char

SO lets try with spaces sir.
So this time i tried with 1000 chars and batch size 1 whose length is 30 by not removing spaces and results are as follows:
predicted_text=yt o oryuaTsy sye o-ssst o eb,
epoch #384	train_loss: 8.89e-02	valid_loss: 0.00e+00


cht syt,t o o eb,t,t s o sso ol
epoch #385	train_loss: 7.21e-02	valid_loss: 0.00e+00


c ot,tret e olebe o olyt,t,t,t 
epoch #386	train_loss: 7.94e-02	valid_loss: 0.00e+00

train_loss: 1.09e-01 avg_loss: 9.11e-02 : 100%


ci o yt solyeb,t,t onle e syeb,
epoch #387	train_loss: 9.11e-02	valid_loss: 0.00e+00

It will converge to 0.but predicted text is TEXT not repeating a char.So i think it is not repeating spaces at all.So i think it is good

So i am getting doubt in culprit batch size.So i will increase the batch size to 5
I overfit the data for 750 epochs
Here are the results:
cta madraol mck  t eulkthlTvonh
epoch #496	train_loss: 2.02e-01	valid_loss: 0.00e+00


cii slmal eeta o m yt<EOS>mrs  a  h
epoch #497	train_loss: 1.98e-01	valid_loss: 0.00e+00


cneewntn Bee hew o kl    a o  h
epoch #498	train_loss: 1.96e-01	valid_loss: 0.00e+00


co<EOS>f yniimwy6  chm'hgrted oese 
epoch #499	train_loss: 1.96e-01	valid_loss: 0.00e+00


coadkth at  teadsrs  ho w:ognsk
epoch #500	train_loss: 1.94e-01	valid_loss: 0.00e+00


The results are not bad like there is no repeating spaces.For first 10 epochs it is repeating spaces but after 50 epochs it starts to print other chars slowly
So So i will increase the batch size to 20
c     s  Ce <EOS>9f            eoh 
epoch #496	train_loss: 1.33e-01	valid_loss: 0.00e+00


cd  s s s    e      ee         
epoch #497	train_loss: 1.34e-01	valid_loss: 0.00e+00


c     e o  e        ere r   rt 
epoch #498	train_loss: 1.34e-01	valid_loss: 0.00e+00


c-   f          h r e   s e   e
epoch #499	train_loss: 1.33e-01	valid_loss: 0.00e+00


c    e  e    ee ree     th Bae 
epoch #500	train_loss: 1.33e-01	valid_loss: 0.00e+00

For 200 epochs it is printing only spaces but after that it started to print results like above
**Graph is like below **
Thank you sir.
Conclusions:
1)It is good for batch size 1,5
2)It is okay for batch size 20
3)It is bad like printing spaces again and again for batch size 32
Waiting for your reply sir.