hi @madhuryadav,
you could try to use onnxruntime   for this to get some speed-up. Here’s a notebook 46 which shows, how to use onnxruntime for bert.
This could also help
  
      
      github.com
  
  
    

patil-suraj/onnx_transformers 17


  Accelerated NLP pipelines for fast inference on CPU. Built with Transformers and ONNX runtime.