Chatgpt gives a decent answer to that question: One option you could consider is using a transformer-based language model, such as BERT or GPT-3, which can then be fine-tuned for a specific task including code completion.