Use custom code in model card inference API widget

Hi, I just published a model to HF Hub. The model uses custom code for inference. As a result, the Inference API widget for people to use the model in their browsers is not displayed on the Hub model card. Is there any solution to this? E.g., will hosting the model at an Inference Endpoint give me the widget?