Rather than using dataset.map function, if I just use a for loop around self.preprocess it completes within 20 milliseconds!
I understand this is probably an issue of Datasets library (version 2.0.1). I just wanted to know if anyone else has faced this issue and if there is a simple solution here which I am probably missing.
I am trying to encode one short string into an embedding. But it takes 3.8 seconds to execute!
While trying to debug, I found that that one line in the
fclip.encode_text
function takes up all the time:Rather than using
dataset.map
function, if I just use afor loop
aroundself.preprocess
it completes within 20 milliseconds!I understand this is probably an issue of Datasets library (version
2.0.1
). I just wanted to know if anyone else has faced this issue and if there is a simple solution here which I am probably missing.