Can't import class inside the .mpy file

I’m using esp32 board . Because of memory error i planned to compile .mpy files which will have less size . By using mpy-cross i created a file which have class inside that file. I saved mpy file in my esp32-wroom32 device.but i cannot import the class.
But when i used this binary file ESP32_GENERIC-20240222-v1.22.2(.bin) i can import class.
I am facing the issue when i use the lv_micropython firmware .How to solve it?