Commit
·
9f93060
verified
·
0
Parent(s):
Super-squash: keep only latest state and drop old LFS blobs
Browse files- .gitattributes +35 -0
- README.md +235 -0
- adapter_config.json +37 -0
- adapter_model.safetensors +3 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +84 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Finnish-NLP/Ahma-3B-Instruct
|
3 |
+
tags:
|
4 |
+
- transformers
|
5 |
+
- unsloth
|
6 |
+
- llama
|
7 |
+
- peft
|
8 |
+
- finnish
|
9 |
+
- medical
|
10 |
+
- dental
|
11 |
+
- healthcare
|
12 |
+
- research-only
|
13 |
+
license: apache-2.0
|
14 |
+
language:
|
15 |
+
- fi
|
16 |
+
library_name: peft
|
17 |
+
---
|
18 |
+
|
19 |
+
# Finnish-DentalQA-lora
|
20 |
+
|
21 |
+
**Finnish-language conversational AI assistant specialized for dental medicine.** This is a fine-tuned large language model (LLM) that generates structured text responses to dental consultation queries, designed to simulate professional dentist-to-dentist consultations with clinical reasoning and recommendations.
|
22 |
+
|
23 |
+
**RESEARCH USE ONLY - NOT FOR MEDICAL DECISIONS**
|
24 |
+
|
25 |
+
- **Developed by:** [Heikki Saxén](https://fi.linkedin.com/in/heikkisaxen) / [Duckling Codehouse Oy](https://www.linkedin.com/company/duckling-codehouse-oy/) ([ducklingcodehouse](https://huggingface.co/ducklingcodehouse))
|
26 |
+
- **Supported by:** [Entteri Professional Software Oy](https://www.entteri.com/) (makers of AssisDent dental PMS)
|
27 |
+
- **License:** apache-2.0
|
28 |
+
- **Base Model:** Finnish-NLP/Ahma-3B-Instruct (by Aapo Tanskanen & Rasmus Toivanen)
|
29 |
+
- **Context Length:** 2048 tokens
|
30 |
+
- **Release Date:** August 20, 2025
|
31 |
+
|
32 |
+
LoRA adapter for Finnish dental medicine consultations between healthcare professionals. Trained on 30,908 synthetic dental conversations (80% expert clinical cases, 20% concept explanations) covering a broad range of different scenarios. Generated using pipeline with GPT-4.1.
|
33 |
+
|
34 |
+
**Research Focus:** This model demonstrates domain-specific fine-tuning with low computational resources. The goal is to explore how specialized models can be trained and deployed on consumer hardware (including personal GPUs) rather than requiring high-end infrastructure.
|
35 |
+
|
36 |
+
**System prompt recommendation:** This model was trained with a specific system prompt. For best results, we recommend using the same prompt format shown in the examples below.
|
37 |
+
|
38 |
+
**Response Format:** The model is trained to structure all clinical responses in three sections: "### Tausta" (Background), "### Arvio" (Assessment), "### Suositus" (Recommendation).
|
39 |
+
|
40 |
+
**Context Limit:** 2048 tokens total (input + output). Long conversations may need trimming to fit within this limit.
|
41 |
+
|
42 |
+
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's Transformers library.
|
43 |
+
|
44 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
45 |
+
|
46 |
+
## Model Comparison
|
47 |
+
|
48 |
+
**LoRA Version**: Separate adapter files, requires base model
|
49 |
+
|
50 |
+
**Merged Version**: LoRA adapters merged into standalone model, no additional files needed
|
51 |
+
|
52 |
+
## Installation
|
53 |
+
|
54 |
+
```bash
|
55 |
+
pip install transformers torch peft accelerate
|
56 |
+
```
|
57 |
+
|
58 |
+
## Loading the Model
|
59 |
+
|
60 |
+
```python
|
61 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
62 |
+
from peft import PeftModel
|
63 |
+
import torch
|
64 |
+
|
65 |
+
# Load base + LoRA
|
66 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
67 |
+
"Finnish-NLP/Ahma-3B-Instruct",
|
68 |
+
torch_dtype=torch.float16, # Recommended: FP16 for base model
|
69 |
+
device_map="auto"
|
70 |
+
)
|
71 |
+
model = PeftModel.from_pretrained(base_model, "ducklingcodehouse/Finnish-DentalQA-lora")
|
72 |
+
|
73 |
+
model = model.merge_and_unload()
|
74 |
+
|
75 |
+
# Load tokenizer from adapter model
|
76 |
+
tokenizer = AutoTokenizer.from_pretrained("ducklingcodehouse/Finnish-DentalQA-lora")
|
77 |
+
```
|
78 |
+
|
79 |
+
## Generate Response
|
80 |
+
|
81 |
+
```python
|
82 |
+
# Use exact system prompt from training
|
83 |
+
system_prompt = """Olet kokenut suomalainen hammaslääkäri. Vastaat ammattimaisesti kollegojesi
|
84 |
+
kysymyksiin käyttäen oikeaa hammaslääketieteellistä terminologiaa ja viittaat Käypä hoito
|
85 |
+
-suosituksiin kun relevanttia."""
|
86 |
+
|
87 |
+
user_question = """87-vuotias nainen, jolla on vaikea muistisairaus, asuu palvelutalossa ja on
|
88 |
+
kotihoidon piirissä. Potilaalla on hampaattomuus, yläleuan kokoproteesi ja alaleuassa 6
|
89 |
+
luonnollista hammasta. Lääkityksenä on mm. rivaroksabaani eteisvärinään, donepetsiili,
|
90 |
+
metoprololi, kalsium+D-vitamiini, sekä useita muita lääkkeitä (yhteensä 9). Suun limakalvot
|
91 |
+
ovat kuivat, kielessä fissuroitumista, ja proteesin alla lievää punoitusta. HbA1c 46 mmol/mol,
|
92 |
+
BMI 22. Kotihoito raportoi potilaan nielevän huonosti ja syljen erityksen olevan vähäistä.
|
93 |
+
Karies- ja parodontiittiriski arvioidaan korkeaksi. Miten suosittelisit suun hoidon
|
94 |
+
järjestämistä ja priorisointia tässä tilanteessa?"""
|
95 |
+
|
96 |
+
messages = [
|
97 |
+
{"role": "system", "content": system_prompt},
|
98 |
+
{"role": "user", "content": user_question}
|
99 |
+
]
|
100 |
+
|
101 |
+
inputs = tokenizer.apply_chat_template(
|
102 |
+
messages,
|
103 |
+
tokenize=True,
|
104 |
+
add_generation_prompt=True,
|
105 |
+
return_tensors="pt"
|
106 |
+
).to(model.device)
|
107 |
+
|
108 |
+
# Recommended settings
|
109 |
+
with torch.no_grad():
|
110 |
+
outputs = model.generate(
|
111 |
+
inputs,
|
112 |
+
max_new_tokens=600,
|
113 |
+
temperature=0.1,
|
114 |
+
do_sample=True,
|
115 |
+
top_p=0.9,
|
116 |
+
repetition_penalty=1.2,
|
117 |
+
pad_token_id=tokenizer.pad_token_id
|
118 |
+
)
|
119 |
+
|
120 |
+
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
|
121 |
+
print(response)
|
122 |
+
|
123 |
+
# Expected example response:
|
124 |
+
# ### Tausta
|
125 |
+
# Potilas on iäkäs, monisairas ja käyttää antikoagulanttihoitoa (rivaroksabaani), mikä
|
126 |
+
# lisää vuotoriskiä toimenpiteissä. Kuiva suu liittyy sekä lääkitykseen että ikääntymiseen.
|
127 |
+
# Hampaattomuus ja vähäinen syljeneritys altistavat limakalvovaurioille ja infektioille.
|
128 |
+
# Nielemisvaikeudet ja korkea karies- ja parodontiittiriski korostavat ehkäisevien
|
129 |
+
# toimenpiteiden merkitystä.
|
130 |
+
#
|
131 |
+
# ### Arvio
|
132 |
+
# Kliinisesti potilaalla on merkittävä hyposalivaatio (stimuloitu sylki <0,7 ml/min),
|
133 |
+
# joka yhdessä polyfarmasian kanssa lisää riskiä limakalvosairauksille ja infektioille.
|
134 |
+
# Proteesin alla oleva punoitus voi viitata proteesi-stomatiittiin tai kandidaasiin.
|
135 |
+
# Rivaroksabaanin vuoksi invasiivisia toimenpiteitä tulee välttää ellei välttämätöntä.
|
136 |
+
# Kotihoidon resurssit ja potilaan toimintakyky rajoittavat laajojen hoitojen toteutusta.
|
137 |
+
#
|
138 |
+
# ### Suositus
|
139 |
+
# Painopiste on limakalvojen kosteutuksessa (esim. keinotekoiset syljentuotteet) ja
|
140 |
+
# proteesin puhtauden ylläpidossa. Kotihoidolle annetaan selkeät ohjeet päivittäisestä
|
141 |
+
# proteesin puhdistuksesta ja limakalvojen tarkkailusta. Syljen eritystä voidaan tukea
|
142 |
+
# säännöllisellä nesteytyksellä ja tarvittaessa ksylitolituotteilla. Lääkärin kanssa
|
143 |
+
# arvioidaan mahdollisuudet vähentää kuivan suun aiheuttajia. Säännöllinen suun tarkastus
|
144 |
+
# (3–6 kk välein) on suositeltavaa. Käypä hoito -suositukset: "Lyhentyneen hammaskaaren
|
145 |
+
# hoito", "Karies (hallinta)" ja "Parodontiitti".
|
146 |
+
```
|
147 |
+
|
148 |
+
## Example
|
149 |
+
|
150 |
+
**User:** 27-vuotias mies, jolla on voimakas kipu ja turvotus alaleuan oikealla puolella. Viisaudenhammas 48 on puoliksi puhkeamassa, ympärillä runsasta ienturvotusta ja märkäkertymä. Potilaalla on kuumetta 38,3°C ja suun avausrajoitus 22 mm. Mitä ensihoitoa suosittelet terveyskeskuksessa?
|
151 |
+
|
152 |
+
**Assistant:**
|
153 |
+
### Tausta
|
154 |
+
Potilas esittäytyy tyypillisin akuutin perikoroniitin oirein: kuume, paikallinen turvotus sekä trismus (avausrajoitus 22 mm). Puoliksi puhjenneen viisaudenhampaan (48) ympärillä oleva runsas ienturvotus ja märkäkertymä viittaavat paikalliseen infektioon, joka voi levitä syvempiin kudoksiin. Suun avausrajoitus (trismus) lisää riskiä infektion leviämiselle esimerkiksi submandibulaaritilaan.
|
155 |
+
|
156 |
+
### Arvio
|
157 |
+
Kliininen kuva sopii akuuttiin perikoroniittiin komplisoituneena paikallisella absessilla tai flegmoonalla. Kuume ja yleisoireet täyttävät mikrobilääkehoidon aloituskriteerit Käypä hoito -suositusten mukaan. Trismus vaikeuttaa paikallista puhdistusta ja altistaa infektion leviämiselle. Märkäkertymän dreneeraus on ensisijaista, mutta myös antibioottihoito on tarpeen.
|
158 |
+
|
159 |
+
### Suositus
|
160 |
+
Aloita amoksisilliini 500 mg x 3 po ja metronidatsoli 500 mg x 2 po suun kautta 7 päivän ajan. Kipulääkitys parasetamolilla ja/tai tulehduskipulääkkeellä. Huuhtele suu klooriheksidiinillä 1–2 kertaa päivässä. Mikäli potilaan yleistila heikkenee tai ilmaantuu nielemisvaikeuksia/hengitystieoireita, päivystyslähete erikoissairaanhoitoon on aiheellinen. Seuraa tilannetta tiiviisti; mikäli avausrajoitus pahenee tai yleisvointi huononee, sairaalahoito voi olla tarpeen.
|
161 |
+
|
162 |
+
**Follow-up:** Potilas palaa seuraavana päivänä. Kuume on noussut 39,2 °C:een, suun avaus onnistuu enää 10 mm, alaleuan oikea puoli on selvästi turvonnut ja nieleminen on kivuliasta. Hengitys on hieman rohisevaa. Mitä toimenpiteitä suosittelet tässä vaiheessa?
|
163 |
+
|
164 |
+
**Assistant:**
|
165 |
+
### Tausta
|
166 |
+
Potilaan tila on selvästi pahentunut: kuume noussut 39,2 °C:een, suun avausrajoitus pahentunut (nyt vain 10 mm), oikean puolen turvotus lisääntynyt ja nieleminen vaikeutunut. Nämä löydökset viittaavat syvemmälle levinneeseen infektioprosessiin, mahdollisesti alkavaan flegmonaan tai abskessiin.
|
167 |
+
|
168 |
+
### Arvio
|
169 |
+
Kyseessä on vakava infektio, jossa on riski hengitysteiden kompromissille ja septiselle kehitykselle. Suun avauksen rajoittuminen alle 20 mm sekä nielemisvaikeus ovat merkkejä siitä, että infektio saattaa olla levinnyt syvempiin kaulan tiloihin. Märän dreenauksen onnistuminen on kriittistä, mutta trismuksen vuoksi tämä voi olla haastavaa.
|
170 |
+
|
171 |
+
### Suositus
|
172 |
+
Potilas tulee lähettää välittömästi päivystykseen sairaalatasolle suonensisäisen antibioottihoidon ja mahdollisen kirurgisen dreneerauksen arvioon. Hengitysteiden turvaaminen on ensisijainen prioriteetti – tarvittaessa anestesialääkärin arvio. Mikrobilääkehoitoa jatketaan sairaalassa suositusten mukaisesti. Seuranta tehostetussa valvonnassa on välttämätöntä komplikaatioiden varalta.
|
173 |
+
|
174 |
+
## Training Details
|
175 |
+
- **Method:** LoRA (r=64, alpha=128, dropout=0.05)
|
176 |
+
- **Learning Rate:** 0.0002
|
177 |
+
- **Epochs:** 3
|
178 |
+
- **Effective Batch Size:** 64
|
179 |
+
- **Precision:** Mixed precision - mostly FP32 with some BF16 tensors, auto-casts to base model's FP16 on load
|
180 |
+
- **Embedding Training:** Enabled for domain specialization
|
181 |
+
- **Target Modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
182 |
+
- **Data:** 30,908 conversations covering a broad range of different scenarios
|
183 |
+
- **Context:** 2048 tokens (inherited from Ahma-3B-Instruct)
|
184 |
+
- **Hardware:** H100 GPU with Unsloth optimizations
|
185 |
+
- **Training Performance:** Loss curves showed steady convergence with final values well below 1.0, indicating successful learning without overfitting
|
186 |
+
|
187 |
+
## Limitations and Important Notes
|
188 |
+
|
189 |
+
**Critical Medical Disclaimers:**
|
190 |
+
- Research purposes only - never use for actual medical decisions
|
191 |
+
- Model may hallucinate medical facts, treatments, or drug interactions
|
192 |
+
- Outputs have not been clinically validated and may contain medical misinformation
|
193 |
+
- All outputs require independent professional verification before any clinical application
|
194 |
+
- No liability is assumed for any consequences of model use
|
195 |
+
|
196 |
+
**Technical Limitations:**
|
197 |
+
- Primarily trained for dentist-to-dentist consultations - concept explanations included but not the main focus
|
198 |
+
- May particularly hallucinate on out-of-scope topics (further training could address this)
|
199 |
+
- Further fine-tuning may be needed for specific use cases
|
200 |
+
- System prompt dependency - using the training prompt is highly recommended
|
201 |
+
- 2048 token context limit affects both training and inference
|
202 |
+
- No formal evaluation - quality assessment has been primarily subjective
|
203 |
+
|
204 |
+
**Bias and Fairness:**
|
205 |
+
- Training data consists of synthetic conversations which may contain inherent biases
|
206 |
+
- Model responses may reflect biases present in the GPT-4.1 generated training data
|
207 |
+
- Geographic and cultural biases toward Finnish dental practices and protocols
|
208 |
+
- Potential underrepresentation of certain patient demographics or clinical scenarios
|
209 |
+
|
210 |
+
## Related Models
|
211 |
+
- Merged version: [ducklingcodehouse/Finnish-DentalQA-merged](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-merged)
|
212 |
+
- Base model: [Finnish-NLP/Ahma-3B-Instruct](https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct)
|
213 |
+
|
214 |
+
## Citation
|
215 |
+
|
216 |
+
If you use this model, please cite both this work and the base Ahma model:
|
217 |
+
|
218 |
+
```bibtex
|
219 |
+
@misc{finnish-dentalqa-lora,
|
220 |
+
author = {Saxén, Heikki},
|
221 |
+
title = {Finnish-DentalQA-lora: LoRA Adapter for Finnish Dental Medicine},
|
222 |
+
year = {2025},
|
223 |
+
month = {August},
|
224 |
+
publisher = {Hugging Face},
|
225 |
+
url = {https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-lora}
|
226 |
+
}
|
227 |
+
|
228 |
+
@misc{ahma-3b-instruct,
|
229 |
+
author = {Tanskanen, Aapo and Toivanen, Rasmus},
|
230 |
+
title = {Ahma-3B-Instruct},
|
231 |
+
year = {2024},
|
232 |
+
publisher = {Hugging Face},
|
233 |
+
url = {https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct}
|
234 |
+
}
|
235 |
+
```
|
adapter_config.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "Finnish-NLP/Ahma-3B-Instruct",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": false,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layer_replication": null,
|
10 |
+
"layers_pattern": null,
|
11 |
+
"layers_to_transform": null,
|
12 |
+
"loftq_config": {},
|
13 |
+
"lora_alpha": 128,
|
14 |
+
"lora_dropout": 0.05,
|
15 |
+
"megatron_config": null,
|
16 |
+
"megatron_core": "megatron.core",
|
17 |
+
"modules_to_save": [
|
18 |
+
"lm_head",
|
19 |
+
"embed_tokens"
|
20 |
+
],
|
21 |
+
"peft_type": "LORA",
|
22 |
+
"r": 64,
|
23 |
+
"rank_pattern": {},
|
24 |
+
"revision": null,
|
25 |
+
"target_modules": [
|
26 |
+
"gate_proj",
|
27 |
+
"k_proj",
|
28 |
+
"o_proj",
|
29 |
+
"up_proj",
|
30 |
+
"down_proj",
|
31 |
+
"q_proj",
|
32 |
+
"v_proj"
|
33 |
+
],
|
34 |
+
"task_type": "CAUSAL_LM",
|
35 |
+
"use_dora": false,
|
36 |
+
"use_rslora": false
|
37 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1116ace70a2d9924b9fc774ebc034bd12ecd09878e17c6cc339784153d164e4b
|
3 |
+
size 1229353552
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<PAD>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": true,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": true,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"3": {
|
31 |
+
"content": "[INST]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"4": {
|
39 |
+
"content": "[/INST]",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"5": {
|
47 |
+
"content": "<<SYS>>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
+
"6": {
|
55 |
+
"content": "<</SYS>>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": false,
|
59 |
+
"single_word": false,
|
60 |
+
"special": true
|
61 |
+
},
|
62 |
+
"64256": {
|
63 |
+
"content": "<PAD>",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": true,
|
66 |
+
"rstrip": false,
|
67 |
+
"single_word": false,
|
68 |
+
"special": true
|
69 |
+
}
|
70 |
+
},
|
71 |
+
"bos_token": "<s>",
|
72 |
+
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = 'Olet kokenut suomalainen hammaslääkäri. Vastaat ammattimaisesti kollegojesi kysymyksiin käyttäen oikeaa hammaslääketieteellistä terminologiaa ja viittaat Käypä hoito -suosituksiin kun relevanttia.' %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>\\n' + system_message + '\\n<</SYS>>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + ' [INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + eos_token }}{% endif %}{% endfor %}",
|
73 |
+
"clean_up_tokenization_spaces": true,
|
74 |
+
"eos_token": "</s>",
|
75 |
+
"legacy": false,
|
76 |
+
"model_max_length": 2048,
|
77 |
+
"pad_token": "<PAD>",
|
78 |
+
"padding_side": "left",
|
79 |
+
"sp_model_kwargs": {},
|
80 |
+
"spaces_between_special_tokens": false,
|
81 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
82 |
+
"unk_token": "<unk>",
|
83 |
+
"use_default_system_prompt": false
|
84 |
+
}
|