abideen commited on
Commit
006bbc4
·
verified ·
1 Parent(s): 0bffad5

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +63 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-nd-4.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ tags:
7
+ - reward model
8
+ - RLHF
9
+ - medical
10
+ ---
11
+
12
+ # JSL-MedMNX-7B-SFT
13
+
14
+ JSL-MedMNX-7B-SFT is an SFT - finetuned on an alpaca format 11k medical dataset over the base model [JSL-MedMNX-7B](https://huggingface.co/johnsnowlabs/JSL-MedMNX-7B). This model is on average 2 points better than the base model on [Open Medical LLM Leaderboard](https://huggingface.co/spaces/openlifescienceai/open_medical_llm_leaderboard).
15
+
16
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/64fc6d81d75293f417fee1d1/fPuZ58tLhZd7wMHZCkWKW.jpeg)
17
+
18
+ ## 💻 Usage
19
+
20
+ ```python
21
+ !pip install -qU transformers accelerate
22
+
23
+ from transformers import AutoTokenizer
24
+ import transformers
25
+ import torch
26
+
27
+ model = "johnsnowlabs/JSL-MedMNX-7B-SFT"
28
+ messages = [{"role": "user", "content": "What is a large language model?"}]
29
+
30
+ tokenizer = AutoTokenizer.from_pretrained(model)
31
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
32
+ pipeline = transformers.pipeline(
33
+ "text-generation",
34
+ model=model,
35
+ torch_dtype=torch.float16,
36
+ device_map="auto",
37
+ )
38
+
39
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
40
+ print(outputs[0]["generated_text"])
41
+ ```
42
+ ## 🏆 Evaluation
43
+
44
+ | Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
45
+ |-------------------------------|-------|------|-----:|--------|-----:|---|-----:|
46
+ |stem |N/A |none | 0|acc_norm|0.5209|± |0.0068|
47
+ | | |none | 0|acc |0.5675|± |0.0058|
48
+ | - medmcqa |Yaml |none | 0|acc |0.5152|± |0.0077|
49
+ | | |none | 0|acc_norm|0.5152|± |0.0077|
50
+ | - medqa_4options |Yaml |none | 0|acc |0.5397|± |0.0140|
51
+ | | |none | 0|acc_norm|0.5397|± |0.0140|
52
+ | - anatomy (mmlu) | 0|none | 0|acc |0.6593|± |0.0409|
53
+ | - clinical_knowledge (mmlu) | 0|none | 0|acc |0.7245|± |0.0275|
54
+ | - college_biology (mmlu) | 0|none | 0|acc |0.7431|± |0.0365|
55
+ | - college_medicine (mmlu) | 0|none | 0|acc |0.6532|± |0.0363|
56
+ | - medical_genetics (mmlu) | 0|none | 0|acc |0.7300|± |0.0446|
57
+ | - professional_medicine (mmlu)| 0|none | 0|acc |0.7206|± |0.0273|
58
+ | - pubmedqa | 1|none | 0|acc |0.7720|± |0.0188|
59
+
60
+ |Groups|Version|Filter|n-shot| Metric |Value | |Stderr|
61
+ |------|-------|------|-----:|--------|-----:|---|-----:|
62
+ |stem |N/A |none | 0|acc_norm|0.5209|± |0.0068|
63
+ | | |none | 0|acc |0.5675|± |0.0058|