With an LLM of around 70B, there are quite a few tasks that it struggles with, so I think it’s better to format the code with your own script to some extent before passing it on, as this tends to yield more accurate results. Simplify the task itself.
Also, if you’re not set on CodeLlama, you could try other coding models as well.