Closed subhamkhemka closed 3 years ago
Hi @subhamkhemka,
I'm not sure I'm able to help you with this issue, it seems related to the multiprocessing package and its attempts to pickle a particular gradient function. All I know is that strange things can happen when pickling such objects especially in a multiprocessing environment, sorry I couldn't be of more help.
no worries, thanks for taking a look @cdpierse
I need to run this for a large dataset of about 1M sentences, do you have any auggestions on how I could speed up the process ?
Thanks
@subhamkhemka 1M sentences is definitely never going to be a fast process to calculate attributions because of how the attributions are calculated but if you wanted to get them calculated as fast as possible I would:
n_steps
in the explainers method call e.g. zero_shot_explainer(sentence, labels=tags, n_steps=custom_n_value)
The default value for n_steps
is 50 so reducing this will definitely speed up the attribution calculation but it will almost certainly reduce the accuracy or quality of the attributions so I'd be careful of reducing it all the way down to 1. If I were you I would do some tests and assess the quality of attributions at different values of n_steps
and go from there.
To use n_steps
make sure you are using the latest version of the package 0.5.2
Good luck with this :-)
Thanks, will definitely try this out. @cdpierse
I am running these in a loop currently, is batch inference supported or part of roadmap ?
@cdpierse It's not something I have planned on the current roadmap. I don't think technically it is too much work as it would just be a wrapper around the existing explainers that runs over n
inputs. But most people will probably be fine using a loop like you are.
Hi
Running the below code, getting an error when using multiprocessing. Please help
Error -
Can you please assist ?
Regards, Subham