malhajar commited on
Commit
9060257
1 Parent(s): 79725c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -1
README.md CHANGED
@@ -4,4 +4,55 @@ datasets:
4
  - malhajar/meditron-tr
5
  language:
6
  - tr
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - malhajar/meditron-tr
5
  language:
6
  - tr
7
+ ---
8
+
9
+ # Model Card for Model ID
10
+
11
+ <!-- Provide a quick summary of what the model is/does. -->
12
+ meditron-7b-chat-turkish is a finetuned version on turkish language Alpaca of [`epfl-llm/meditron-7b`](https://huggingface.co/epfl-llm/meditron-7b) using SFT Training.
13
+ 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)
14
+
15
+ ### Model Description
16
+
17
+ - **Finetuned by:** [`Mohamad Alhajar`](https://www.linkedin.com/in/muhammet-alhajar/)
18
+ - **Language(s) (NLP):** Turkish,English
19
+ - **Finetuned from model:** [`epfl-llm/meditron-7b`](https://huggingface.co/epfl-llm/meditron-7b)
20
+
21
+ ### Prompt Template
22
+ ```
23
+ ### Talimat:
24
+
25
+ <prompt> (without the <>)
26
+
27
+ ### Yanıt:
28
+ ```
29
+
30
+
31
+ ## How to Get Started with the Model
32
+
33
+ Use the code sample provided in the original post to interact with the model.
34
+ ```python
35
+ from transformers import AutoTokenizer,AutoModelForCausalLM
36
+
37
+ model_id = "malhajar/meditron-7b-chat-turkish"
38
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
39
+ device_map="auto",
40
+ torch_dtype=torch.float16,
41
+ revision="main")
42
+
43
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
44
+
45
+ question: "Akciğer kanseri nedir?"
46
+ # For generating a response
47
+ prompt = '''
48
+ ### Instruction:
49
+ {question}
50
+
51
+ ### Response:'''
52
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids
53
+ output = model.generate(inputs=input_ids,max_new_tokens=512,pad_token_id=tokenizer.eos_token_id,top_k=50, do_sample=True,
54
+ top_p=0.95)
55
+ response = tokenizer.decode(output[0])
56
+
57
+ print(response)
58
+ ```