Text Generation
Transformers
Safetensors
Finnish
llama
unsloth
finnish
medical
dental
healthcare
research-only
conversational
text-generation-inference
Instructions to use ducklingcodehouse/Finnish-DentalQA-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ducklingcodehouse/Finnish-DentalQA-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ducklingcodehouse/Finnish-DentalQA-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ducklingcodehouse/Finnish-DentalQA-merged") model = AutoModelForCausalLM.from_pretrained("ducklingcodehouse/Finnish-DentalQA-merged", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ducklingcodehouse/Finnish-DentalQA-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ducklingcodehouse/Finnish-DentalQA-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ducklingcodehouse/Finnish-DentalQA-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ducklingcodehouse/Finnish-DentalQA-merged
- SGLang
How to use ducklingcodehouse/Finnish-DentalQA-merged with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ducklingcodehouse/Finnish-DentalQA-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ducklingcodehouse/Finnish-DentalQA-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ducklingcodehouse/Finnish-DentalQA-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ducklingcodehouse/Finnish-DentalQA-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use ducklingcodehouse/Finnish-DentalQA-merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ducklingcodehouse/Finnish-DentalQA-merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ducklingcodehouse/Finnish-DentalQA-merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ducklingcodehouse/Finnish-DentalQA-merged to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ducklingcodehouse/Finnish-DentalQA-merged", max_seq_length=2048, ) - Docker Model Runner
How to use ducklingcodehouse/Finnish-DentalQA-merged with Docker Model Runner:
docker model run hf.co/ducklingcodehouse/Finnish-DentalQA-merged
Update model card
Browse files
README.md
CHANGED
|
@@ -17,7 +17,7 @@ base_model: Finnish-NLP/Ahma-3B-Instruct
|
|
| 17 |
|
| 18 |
# Finnish-DentalQA-merged
|
| 19 |
|
| 20 |
-
**Note:
|
| 21 |
|
| 22 |
**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.
|
| 23 |
|
|
@@ -46,13 +46,21 @@ This llama model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
| 46 |
|
| 47 |
## Model Comparison
|
| 48 |
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
**
|
| 52 |
|
| 53 |
-
**v2 LoRA Version**: [ducklingcodehouse/Finnish-DentalQA-v2-lora](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-lora) - Enhanced training (50,132 samples
|
| 54 |
|
| 55 |
-
**v2 Merged Version**: [ducklingcodehouse/Finnish-DentalQA-v2-merged](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-merged) - Enhanced training (50,132 samples
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
## Installation
|
| 58 |
|
|
@@ -78,17 +86,17 @@ tokenizer = AutoTokenizer.from_pretrained("ducklingcodehouse/Finnish-DentalQA-me
|
|
| 78 |
|
| 79 |
```python
|
| 80 |
# Use exact system prompt from training
|
| 81 |
-
system_prompt = """Olet kokenut suomalainen hammaslääkäri. Vastaat ammattimaisesti kollegojesi
|
| 82 |
-
kysymyksiin käyttäen oikeaa hammaslääketieteellistä terminologiaa ja viittaat Käypä hoito
|
| 83 |
-suosituksiin kun relevanttia."""
|
| 84 |
|
| 85 |
-
user_question = """87-vuotias nainen, jolla on vaikea muistisairaus, asuu palvelutalossa ja on
|
| 86 |
-
kotihoidon piirissä. Potilaalla on hampaattomuus, yläleuan kokoproteesi ja alaleuassa 6
|
| 87 |
-
luonnollista hammasta. Lääkityksenä on mm. rivaroksabaani eteisvärinään, donepetsiili,
|
| 88 |
-
metoprololi, kalsium+D-vitamiini, sekä useita muita lääkkeitä (yhteensä 9). Suun limakalvot
|
| 89 |
-
ovat kuivat, kielessä fissuroitumista, ja proteesin alla lievää punoitusta. HbA1c 46 mmol/mol,
|
| 90 |
-
BMI 22. Kotihoito raportoi potilaan nielevän huonosti ja syljen erityksen olevan vähäistä.
|
| 91 |
-
Karies- ja parodontiittiriski arvioidaan korkeaksi. Miten suosittelisit suun hoidon
|
| 92 |
järjestämistä ja priorisointia tässä tilanteessa?"""
|
| 93 |
|
| 94 |
messages = [
|
|
@@ -97,9 +105,9 @@ messages = [
|
|
| 97 |
]
|
| 98 |
|
| 99 |
inputs = tokenizer.apply_chat_template(
|
| 100 |
-
messages,
|
| 101 |
-
tokenize=True,
|
| 102 |
-
add_generation_prompt=True,
|
| 103 |
return_tensors="pt"
|
| 104 |
).to(model.device)
|
| 105 |
|
|
@@ -125,14 +133,14 @@ print(response)
|
|
| 125 |
# Hampaattomuus ja vähäinen syljeneritys altistavat limakalvovaurioille ja infektioille.
|
| 126 |
# Nielemisvaikeudet ja korkea karies- ja parodontiittiriski korostavat ehkäisevien
|
| 127 |
# toimenpiteiden merkitystä.
|
| 128 |
-
#
|
| 129 |
# ### Arvio
|
| 130 |
# Kliinisesti potilaalla on merkittävä hyposalivaatio (stimuloitu sylki <0,7 ml/min),
|
| 131 |
# joka yhdessä polyfarmasian kanssa lisää riskiä limakalvosairauksille ja infektioille.
|
| 132 |
# Proteesin alla oleva punoitus voi viitata proteesi-stomatiittiin tai kandidaasiin.
|
| 133 |
# Rivaroksabaanin vuoksi invasiivisia toimenpiteitä tulee välttää ellei välttämätöntä.
|
| 134 |
# Kotihoidon resurssit ja potilaan toimintakyky rajoittavat laajojen hoitojen toteutusta.
|
| 135 |
-
#
|
| 136 |
# ### Suositus
|
| 137 |
# Painopiste on limakalvojen kosteutuksessa (esim. keinotekoiset syljentuotteet) ja
|
| 138 |
# proteesin puhtauden ylläpidossa. Kotihoidolle annetaan selkeät ohjeet päivittäisestä
|
|
@@ -206,9 +214,10 @@ Potilas tulee lähettää välittömästi päivystykseen sairaalatasolle suonens
|
|
| 206 |
- Potential underrepresentation of certain patient demographics or clinical scenarios
|
| 207 |
|
| 208 |
## Related Models
|
| 209 |
-
-
|
| 210 |
-
- v2 LoRA
|
| 211 |
-
- v2 Merged
|
|
|
|
| 212 |
- Base model: [Finnish-NLP/Ahma-3B-Instruct](https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct)
|
| 213 |
|
| 214 |
## Citation
|
|
@@ -232,4 +241,4 @@ If you use this model, please cite both this work and the base Ahma model:
|
|
| 232 |
publisher = {Hugging Face},
|
| 233 |
url = {https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct}
|
| 234 |
}
|
| 235 |
-
```
|
|
|
|
| 17 |
|
| 18 |
# Finnish-DentalQA-merged
|
| 19 |
|
| 20 |
+
**Note: Newer versions are available! See [Finnish-DentalQA-v3](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v3) (recommended, 4B parameters, full fine-tuning on Ahma-2) or [Finnish-DentalQA-v2](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-merged) (enhanced dataset).**
|
| 21 |
|
| 22 |
**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.
|
| 23 |
|
|
|
|
| 46 |
|
| 47 |
## Model Comparison
|
| 48 |
|
| 49 |
+
| Version | Base Model | Parameters | Training Method | Dataset | Notes |
|
| 50 |
+
|---------|-----------|------------|-----------------|---------|-------|
|
| 51 |
+
| v3 | Ahma-2-4B-Instruct | 4B | Full fine-tuning | 50,132 | Latest, highest quality |
|
| 52 |
+
| v2 | Ahma-3B-Instruct | 3B | LoRA | 50,132 | Enhanced dataset, available as LoRA and merged |
|
| 53 |
+
| **v1** | Ahma-3B-Instruct | 3B | LoRA | 30,908 | Original release, available as LoRA and merged |
|
| 54 |
|
| 55 |
+
**v3 (recommended)**: [ducklingcodehouse/Finnish-DentalQA-v3](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v3) - Full fine-tuned on Ahma-2-4B-Instruct, highest quality
|
| 56 |
|
| 57 |
+
**v2 LoRA Version**: [ducklingcodehouse/Finnish-DentalQA-v2-lora](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-lora) - Enhanced training (50,132 samples), separate adapter files, requires base model
|
| 58 |
|
| 59 |
+
**v2 Merged Version**: [ducklingcodehouse/Finnish-DentalQA-v2-merged](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-merged) - Enhanced training (50,132 samples), merged into standalone model
|
| 60 |
+
|
| 61 |
+
**v1 LoRA Version**: [ducklingcodehouse/Finnish-DentalQA-lora](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-lora) - Original dataset (30,908 samples), separate adapter files, requires base model
|
| 62 |
+
|
| 63 |
+
**v1 Merged Version (this model)**: Original dataset (30,908 samples), merged into standalone model
|
| 64 |
|
| 65 |
## Installation
|
| 66 |
|
|
|
|
| 86 |
|
| 87 |
```python
|
| 88 |
# Use exact system prompt from training
|
| 89 |
+
system_prompt = """Olet kokenut suomalainen hammaslääkäri. Vastaat ammattimaisesti kollegojesi
|
| 90 |
+
kysymyksiin käyttäen oikeaa hammaslääketieteellistä terminologiaa ja viittaat Käypä hoito
|
| 91 |
-suosituksiin kun relevanttia."""
|
| 92 |
|
| 93 |
+
user_question = """87-vuotias nainen, jolla on vaikea muistisairaus, asuu palvelutalossa ja on
|
| 94 |
+
kotihoidon piirissä. Potilaalla on hampaattomuus, yläleuan kokoproteesi ja alaleuassa 6
|
| 95 |
+
luonnollista hammasta. Lääkityksenä on mm. rivaroksabaani eteisvärinään, donepetsiili,
|
| 96 |
+
metoprololi, kalsium+D-vitamiini, sekä useita muita lääkkeitä (yhteensä 9). Suun limakalvot
|
| 97 |
+
ovat kuivat, kielessä fissuroitumista, ja proteesin alla lievää punoitusta. HbA1c 46 mmol/mol,
|
| 98 |
+
BMI 22. Kotihoito raportoi potilaan nielevän huonosti ja syljen erityksen olevan vähäistä.
|
| 99 |
+
Karies- ja parodontiittiriski arvioidaan korkeaksi. Miten suosittelisit suun hoidon
|
| 100 |
järjestämistä ja priorisointia tässä tilanteessa?"""
|
| 101 |
|
| 102 |
messages = [
|
|
|
|
| 105 |
]
|
| 106 |
|
| 107 |
inputs = tokenizer.apply_chat_template(
|
| 108 |
+
messages,
|
| 109 |
+
tokenize=True,
|
| 110 |
+
add_generation_prompt=True,
|
| 111 |
return_tensors="pt"
|
| 112 |
).to(model.device)
|
| 113 |
|
|
|
|
| 133 |
# Hampaattomuus ja vähäinen syljeneritys altistavat limakalvovaurioille ja infektioille.
|
| 134 |
# Nielemisvaikeudet ja korkea karies- ja parodontiittiriski korostavat ehkäisevien
|
| 135 |
# toimenpiteiden merkitystä.
|
| 136 |
+
#
|
| 137 |
# ### Arvio
|
| 138 |
# Kliinisesti potilaalla on merkittävä hyposalivaatio (stimuloitu sylki <0,7 ml/min),
|
| 139 |
# joka yhdessä polyfarmasian kanssa lisää riskiä limakalvosairauksille ja infektioille.
|
| 140 |
# Proteesin alla oleva punoitus voi viitata proteesi-stomatiittiin tai kandidaasiin.
|
| 141 |
# Rivaroksabaanin vuoksi invasiivisia toimenpiteitä tulee välttää ellei välttämätöntä.
|
| 142 |
# Kotihoidon resurssit ja potilaan toimintakyky rajoittavat laajojen hoitojen toteutusta.
|
| 143 |
+
#
|
| 144 |
# ### Suositus
|
| 145 |
# Painopiste on limakalvojen kosteutuksessa (esim. keinotekoiset syljentuotteet) ja
|
| 146 |
# proteesin puhtauden ylläpidossa. Kotihoidolle annetaan selkeät ohjeet päivittäisestä
|
|
|
|
| 214 |
- Potential underrepresentation of certain patient demographics or clinical scenarios
|
| 215 |
|
| 216 |
## Related Models
|
| 217 |
+
- v3: [ducklingcodehouse/Finnish-DentalQA-v3](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v3)
|
| 218 |
+
- v2 LoRA: [ducklingcodehouse/Finnish-DentalQA-v2-lora](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-lora)
|
| 219 |
+
- v2 Merged: [ducklingcodehouse/Finnish-DentalQA-v2-merged](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-v2-merged)
|
| 220 |
+
- v1 LoRA: [ducklingcodehouse/Finnish-DentalQA-lora](https://huggingface.co/ducklingcodehouse/Finnish-DentalQA-lora)
|
| 221 |
- Base model: [Finnish-NLP/Ahma-3B-Instruct](https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct)
|
| 222 |
|
| 223 |
## Citation
|
|
|
|
| 241 |
publisher = {Hugging Face},
|
| 242 |
url = {https://huggingface.co/Finnish-NLP/Ahma-3B-Instruct}
|
| 243 |
}
|
| 244 |
+
```
|