Views
No views yet
llama-2-7b-chat-hf model fine-tuned using QLoRA (4-bit precision) on the s200862/medical_qa_meds dataset. This is an adapted version of the medalpaca/medical_meadow_wikidoc_patient_information dataset to match llama-2's instruction format.1# pip install transformers accelerate
2
3from transformers import AutoTokenizer
4import transformers
5import torch
6
7model = "s200862/llama-2-7b-chat-MEDS-12"
8prompt = "What causes Allergy?"
9
10tokenizer = AutoTokenizer.from_pretrained(model)
11pipeline = transformers.pipeline(
12 "text-generation",
13 model=model,
14 torch_dtype=torch.float16,
15 device_map="auto",
16)
17
18sequences = pipeline(
19 f'<s>[INST] {prompt} [/INST]',
20 do_sample=True,
21 top_k=10,
22 num_return_sequences=1,
23 eos_token_id=tokenizer.eos_token_id,
24 max_length=200,
25)
26for seq in sequences:
27 print(f"Result: {seq['generated_text']}")