How can I adapt this code to deploy it in HuggingFace?

Hi, all.

I’d like to know how to adapt the following code so that it can take advantage of the HuggingFace libraries and I can upload the model to the Hub more easily and can make use of the Inference API that’s provided for free.

I used to have this custom fine-tuned model providing predictions running on AWS SageMaker but I’d like to explore other alternatives on how to run it.

The code can be found here.

I’ll appreciate any help!