afrideva commited on
Commit
5cb67c5
1 Parent(s): b548176

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +93 -0
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: malhajar/phi-2-meditron
3
+ datasets:
4
+ - epfl-llm/guidelines
5
+ inference: false
6
+ language:
7
+ - en
8
+ license: ms-pl
9
+ model_creator: malhajar
10
+ model_name: phi-2-meditron
11
+ pipeline_tag: text-generation
12
+ quantized_by: afrideva
13
+ tags:
14
+ - Medicine
15
+ - gguf
16
+ - ggml
17
+ - quantized
18
+ - q2_k
19
+ - q3_k_m
20
+ - q4_k_m
21
+ - q5_k_m
22
+ - q6_k
23
+ - q8_0
24
+ ---
25
+ # malhajar/phi-2-meditron-GGUF
26
+
27
+ Quantized GGUF model files for [phi-2-meditron](https://huggingface.co/malhajar/phi-2-meditron) from [malhajar](https://huggingface.co/malhajar)
28
+
29
+
30
+ | Name | Quant method | Size |
31
+ | ---- | ---- | ---- |
32
+ | [phi-2-meditron.fp16.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.fp16.gguf) | fp16 | 5.56 GB |
33
+ | [phi-2-meditron.q2_k.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q2_k.gguf) | q2_k | 1.17 GB |
34
+ | [phi-2-meditron.q3_k_m.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q3_k_m.gguf) | q3_k_m | 1.48 GB |
35
+ | [phi-2-meditron.q4_k_m.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q4_k_m.gguf) | q4_k_m | 1.79 GB |
36
+ | [phi-2-meditron.q5_k_m.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q5_k_m.gguf) | q5_k_m | 2.07 GB |
37
+ | [phi-2-meditron.q6_k.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q6_k.gguf) | q6_k | 2.29 GB |
38
+ | [phi-2-meditron.q8_0.gguf](https://huggingface.co/afrideva/phi-2-meditron-GGUF/resolve/main/phi-2-meditron.q8_0.gguf) | q8_0 | 2.96 GB |
39
+
40
+
41
+
42
+ ## Original Model Card:
43
+ # Model Card for Model ID
44
+
45
+ <!-- Provide a quick summary of what the model is/does. -->
46
+ phi-2-meditron is a finetuned version of [`epfl-llm/meditron-7b`](https://huggingface.co/epfl-llm/meditron-7b) using SFT Training on the Meditron Dataset.
47
+ This model can answer information about different excplicit ideas in medicine (see [`epfl-llm/meditron-7b`](https://huggingface.co/epfl-llm/meditron-7b) for more info)
48
+
49
+ ### Model Description
50
+
51
+ - **Finetuned by:** [`Mohamad Alhajar`](https://www.linkedin.com/in/muhammet-alhajar/)
52
+ - **Language(s) (NLP):** English
53
+ - **Finetuned from model:** [`microsoft/phi-2`](https://huggingface.co/microsoft/phi-2)
54
+
55
+ ### Prompt Template
56
+ ```
57
+ ### Instruction:
58
+
59
+ <prompt> (without the <>)
60
+
61
+ ### Response:
62
+ ```
63
+
64
+
65
+ ## How to Get Started with the Model
66
+
67
+ Use the code sample provided in the original post to interact with the model.
68
+ ```python
69
+ from transformers import AutoTokenizer,AutoModelForCausalLM
70
+
71
+ model_id = "malhajar/phi-2-meditron"
72
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
73
+ device_map="auto",
74
+ torch_dtype=torch.float16,
75
+ trust_remote_code= True,
76
+ revision="main")
77
+
78
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
79
+
80
+ question: "what is tract infection?"
81
+ # For generating a response
82
+ prompt = '''
83
+ ### Instruction:
84
+ {question}
85
+
86
+ ### Response:'''
87
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids
88
+ output = model.generate(inputs=input_ids,max_new_tokens=512,pad_token_id=tokenizer.eos_token_id,top_k=50, do_sample=True,
89
+ top_p=0.95)
90
+ response = tokenizer.decode(output[0])
91
+
92
+ print(response)
93
+ ```