def get_layers(self) -> list[str]:
                        """
                        Return the hidden layers in the model, if applicable.

                        :return: The hidden layers in the model, input and output layers excluded.

                        .. warning:: `get_layers` tries to infer the internal structure of the model.
                                     This feature comes with no guarantees on the correctness of the result.
                                     The intended order of the layers tries to match their order in the model, but this
                                     is not guaranteed either.
                        """

                        result_dict = {}

                        modules = []

                        def forward_hook(input_module, hook_input, hook_output):
                            logger.info("input_module is %s with id %i", input_module, id(input_module))
                            modules.append(id(input_module))

                        handles = []

                        for name, module in self._model.named_modules():
                            logger.info(
                                "found %s with type %s and id %i and name %s with submods %i ",
                                module,
                                type(module),
                                id(module),
                                name,
                                len(list(module.named_modules())),
                            )

                            if name != "" and len(list(module.named_modules())) == 1:
                                handles.append(module.register_forward_hook(forward_hook))
                                result_dict[id(module)] = name

                        logger.info("mapping from id to name is %s", result_dict)

                        logger.info("------ Finished Registering Hooks------")
                        model(input_for_hook)  # hooks are fired sequentially from model input to the output

                        logger.info("------ Finished Fire Hooks------")

                        # Remove the hooks
                        for hook in handles:
                            hook.remove()

                        logger.info("new result is: ")
                        name_order = []
                        for module in modules:
                            name_order.append(result_dict[module])

                        logger.info(name_order)

                        return name_order

                        Return the hidden layers in the model, if applicable.

                        :return: The hidden layers in the model, input and output layers excluded.

                        .. warning:: `get_layers` tries to infer the internal structure of the model.
                                     This feature comes with no guarantees on the correctness of the result.
                                     The intended order of the layers tries to match their order in the model, but this
                                     is not guaranteed either.
                        
art/estimators/classification/hugging_face.py