Downloads · 30 days
23
6% of all-time downloads
EdwardYu/llama-2-7b-MedQuAD-merged
llama-2-7b-MedQuAD-merged is a text generation model from EdwardYu. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama2.
This model is a merged model of meta Llama2 and EdwardYu/llama-2-7b-MedQuAD.
Downloads · 30 days
23
6% of all-time downloads
All-time downloads
409
Public
Parameters
6.7B
27 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin13.5 GB · 50%
How the weights are stored.
BF166.7B · 100%
From the Hugging Face model README
This model is a merged model of meta Llama2 and EdwardYu/llama-2-7b-MedQuAD.
model_name = "EdwardYu/llama-2-7b-MedQuAD-merged"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
load_in_4bit=True,
torch_dtype=torch.bfloat16,
device_map="auto",
quantization_config=BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type='nf4'
),
)
question = 'What are the side effects or risks of Glucagon?'
inputs = tokenizer(question, return_tensors="pt").to("cuda")
outputs = model.generate(inputs=inputs.input_ids, max_length=1024)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
To run model inference faster, you can load in 16-bits without 4-bit quantization.
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)