JosefAlbers commited on
Commit
310aa3b
1 Parent(s): 434dbdc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -3
README.md CHANGED
@@ -1,3 +1,32 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ datasets:
4
+ - openlifescienceai/medmcqa
5
+ language:
6
+ - en
7
+ metrics:
8
+ - accuracy
9
+ library_name: mlx
10
+ pipeline_tag: text-generation
11
+ tags:
12
+ - medical
13
+ ---
14
+
15
+ LoRA finetune of Phi-3 on `aaditya/Llama3-OpenBioLLM-8B` generated answers to a subset of `openlifescienceai/medmcqa` questions using [LoRA4context](https://github.com/JosefAlbers/LoRA4contex) library.
16
+
17
+ Usage:
18
+
19
+ ```python
20
+ prompt = """A 55- year old diabetic patient presents with transient obscuration in vision for 2-3 days followed by sudden loss of vision. Which of the following would be the best test to evaluate the symptoms?
21
+ A. Serum ACE levels
22
+ B. Quantiferon-Gold TB test
23
+ C. Elevated homocysteine levels
24
+ D. Serum creatinine levels"""
25
+
26
+ from huggingface_hub import HfApi, login, hf_hub_download, snapshot_download
27
+ snapshot_download(repo_id='JosefAlbers/phi-3-usmle', repo_type="model", local_dir=".")
28
+
29
+ from mlx_lm import load, generate
30
+ model, tokenizer = load("mlx-community/Phi-3-mini-4k-instruct-4bit-no-q-embed", tokenizer_config={'eos_token':'<|end|>'}, adapter_path='adapters')
31
+ generate(model, tokenizer, f"<|user|>\n{prompt}\n<|end|>\n<|assistant|>", max_tokens=500)
32
+ ```