Downloads · 30 days
3
4% of all-time downloads
Tharshan/Llama-2-7b-chat-finetune-finchat
Llama-2-7b-chat-finetune-finchat is a machine learning model from Tharshan. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains the code for a fine-tuned banking chatbot using Llama 2-7B with QLoRA. The chatbot is designed to handle a variety of banking-related queries efficiently.
Downloads · 30 days
3
4% of all-time downloads
All-time downloads
77
Public
Repo size
13.5 GB
Likes
1
Public
Click a slice to open those files.
.bin13.5 GB · 100%
From the Hugging Face model README
This repository contains the code for a fine-tuned banking chatbot using Llama 2-7B with QLoRA. The chatbot is designed to handle a variety of banking-related queries efficiently.
Ensure you have Python installed and then install the required dependencies:
pip install -q accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7
The chatbot is fine-tuned using QLoRA on the Llama-2-7B model. Below are the steps to train the model:
model_name = "NousResearch/Llama-2-7b-chat-hf"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, load_in_8bit=True)
##push the fine-tunned model to your hugging face
# Push to Hugging Face Hub
# give your repo
tokenizer.push_to_hub("Tharshan/Llama-2-7b-chat-finetune-finchat", check_pr=True)
model.push_to_hub("Tharshan/Llama-2-7b-ch", check_pr=True)
We use a high-quality dataset containing 1 million banking queries and responses. The dataset provides multiple variations of the same questions with different phrasing and structured answers.
# mention the needed dataset repo
dataset = load_dataset("Tharshan/Bank_Query")
print(dataset["train"][0])
Once fine-tuned, you can load and run the chatbot as follows:
from transformers import pipeline
chatbot = pipeline("text-generation", model="Tharshan/Llama-2-7b-ch")
response = chatbot("What is my account balance?")
print(response)
license: mit datasets: