Downloads · 30 days
4
67% of all-time downloads
Lalitadityaa/llama2_med_finetuned
llama2_med_finetuned is a machine learning model from Lalitadityaa. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repo contains the LoRA adapter weights for a fine-tuned Llama-2 7B Chat model designed for medical question answering and healthcare-related conversations.
Downloads · 30 days
4
67% of all-time downloads
All-time downloads
6
Public
Repo size
134 MB
Likes
0
Public
Click a slice to open those files.
.safetensors134 MB · 97%
From the Hugging Face model README
This repo contains the LoRA adapter weights for a fine-tuned Llama-2 7B Chat model designed for medical question answering and healthcare-related conversations.
Developed by: Lalitaditya M
Model type: LoRA Adapter
Finetuned from model: NousResearch/Llama-2-7b-chat-hf
Use the code below to load the base model and apply the LoRA adapter.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "NousResearch/Llama-2-7b-chat-hf"
adapter = "Lalitadityaa/llama2_med_finetuned"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype="auto",
device_map="auto",
load_in_4bit=True,
)
model = PeftModel.from_pretrained(model, adapter)