Generating code using an LLM
In this recipe, we will explore how an LLM can be used to generate code. We will use two separate examples to check the breadth of coverage for the generation. We will also compare the output from two LLMs to observe how the generation varies across two different models. Applications of such methods are already incorporated in popular Integrated Development Environments (IDEs). Our goal here is to demonstrate a basic framework for how to use a pre-trained LLM to generate code snipped based on simple human-defined requirements.
Getting ready
We will use a model from Hugging Face as well as OpenAI in this recipe. Please refer to Model access under the Technical requirements section to complete the step to access the Llama and OpenAI models. You can use the 10.6_code_generation_with_llm.ipynb
notebook from the code site if you want to work from an existing notebook. Please note that due to the compute requirements for this recipe, it might take a few...