Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4# Load base model (requires Meta approval)
5base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
6tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
7
8# Load LoRA weights
9model = PeftModel.from_pretrained(base_model, "your-username/llama-3.1-8b-indas-lora")
10
11# Use the model for inference
12prompt = "Define the objective of Ind AS 1."
13inputs = tokenizer.encode(prompt, return_tensors="pt")
14outputs = model.generate(inputs, max_new_tokens=512)
15response = tokenizer.decode(outputs[0], skip_special_tokens=True)@misc{llama3.1-indas-lora,
title={Llama-3.1-8B-Instruct LoRA Fine-tuned on Indian Accounting Standards},
author={Your Name},
year={2024},
url={https://huggingface.co/0xadityam/llama-3.1-8b-indas-lora}
}