Object of type float32 is not JSON serializable

I created a custom component model for intent classification in nlu pipeline which is predicting and working fine and rasa policies are predicting the next action fine while debugging with rasa shell --debug the in memory track store gives this error as below

2021-12-15 16:51:17 ERROR    rasa.core.tracker_store  - Error happened when trying to save conversation tracker to 'InMemoryTrackerStore'. Falling back to use the 'InMemoryTrackerStore'.
Please investigate the following error: Object of type float32 is not JSON serializable.
2021-12-15 16:51:17 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'fcf8b26dbf1d4ae18bf81d52197378ab'.
2021-12-15 16:52:20 ERROR    asyncio  - Task exception was never retrieved