
Llama 3 is a family of Large Language Models released by Meta, It is a collection of pre-trained and instruction-tuned generative text models. Llama 3 is pre-trained over 15T tokens collected from publically available sources, it is an auto-regressive family of models that uses an optimized transformer architecture. The instruction-tuned models use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF). The Llama 3 models have a custom limited commercial license which means models can used for commercial and research purposes.
In this article, you are to run inference workloads on the Llama3 8B and Llama 3 8B Instruct models. You also going to be exploring the model benchmarks to evaluate the model performance.
In this section, you are to run inference workloads on the Llama 3 8B base model with 8 billion parameters.
Install the required dependencies.
Log in to the HuggingFace Hub.
On the execution of this command, you will be prompted for an access token. Where you have to provide the token to access the Llama 3 Models.
Import necessary modules.
Declare the Model.
Declare the model pipeline.
In the above code, you declared the model pipeline with the task-generation task. By default, Llama 3 8B is set to 16-bit precision.
Provide a prompt.
In this section, you are to run inference workloads on the Llama 3 8B Instruct model with 8 billion parameters. This model is fine-tuned for dialogue-based use cases.
Import necessary modules.
Declare the model.
Declare the model pipeline.
Set roles for the model.
In the above code, you are setting the roles informing the chatbot that it is a pirate chatbot.
Make a prompt template.
Set the terminators for text generation.
Set the model parameters.
In the above code, you are setting up the model parameters that can be adjusted to improve the response generated by the model.
Print the generated output.
In this article, you used Meta Llama 3 models on a Vultr Cloud GPU Server. And ran inference workloads with the latest Llama 3 80B in 16-bit mode with its fine-tuned Instruct version also in the 16-bit mode.
0 Comments
Be the first to comment and share your perspective with the community.