After fine tuning LLama3
Load the base model (LLama3) using the config.json file
config.json filefrom transformers import LlamaForCausalLM, AutoConfig
config = AutoConfig.from_pretrained("path/to/config.json")
model = LlamaForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B", config=config)Load the LoRA adapter using the adapter_config.json and adapter_model.bin files:
adapter_config.json and adapter_model.bin files:from peft import PeftModel
model = PeftModel.from_pretrained(model, "path/to/adapter_model.bin")Load the tokenizer using the tokenizer_config.json and tokenizer.json files:
tokenizer_config.json and tokenizer.json files:Use the loaded model and tokenizer to run inference on your input text:
Last updated
Was this helpful?

