Text Generation
Transformers
Safetensors
German
English
medical
loinc
terminology-mapping
llama-3
unsloth
conversational
Instructions to use Franc105/loinc-mapper with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Franc105/loinc-mapper with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Franc105/loinc-mapper") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Franc105/loinc-mapper", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Franc105/loinc-mapper with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Franc105/loinc-mapper" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Franc105/loinc-mapper", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Franc105/loinc-mapper
- SGLang
How to use Franc105/loinc-mapper 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 "Franc105/loinc-mapper" \ --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": "Franc105/loinc-mapper", "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 "Franc105/loinc-mapper" \ --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": "Franc105/loinc-mapper", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Franc105/loinc-mapper 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 Franc105/loinc-mapper 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 Franc105/loinc-mapper to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Franc105/loinc-mapper to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Franc105/loinc-mapper", max_seq_length=2048, ) - Docker Model Runner
How to use Franc105/loinc-mapper with Docker Model Runner:
docker model run hf.co/Franc105/loinc-mapper
LOINC Medical Terminology Mapper
Fine-tuned Llama-3.2-3B model for mapping German medical terms to LOINC codes using Chain-of-Thought reasoning.
Model Details
- Base Model: unsloth/Llama-3.2-3B-Instruct
- Fine-tuning Method: LoRA (Low-Rank Adaptation)
- Training Framework: Unsloth + Hugging Face Transformers
- Language: German (primary), English (secondary)
- Task: Medical terminology to LOINC code mapping
Performance
- Accuracy: 0.00%
- Total Samples: 0
- Correct Predictions: 0
Training Configuration
- LoRA Rank: 64
- LoRA Alpha: 128
- Learning Rate: 0.0002
- Batch Size: 64
- Epochs: 1
- Precision: BF16
Usage
from unsloth import FastLanguageModel
# Load model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="Franc105/loinc-mapper",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
# Enable inference mode
FastLanguageModel.for_inference(model)
# Format input
messages = [
{"role": "system", "content": "Du bist ein Experte für medizinische Terminologie und LOINC-Mapping."},
{"role": "user", "content": "Begriff: Glukose\nEinheit: mg/dL\nBeschreibung: Blutzucker"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to("cuda")
# Generate
outputs = model.generate(
input_ids=inputs,
max_new_tokens=512,
temperature=0.1,
top_p=0.9,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Intended Use
This model is designed for:
- Mapping German medical terminology to standardized LOINC codes
- Supporting clinical documentation systems
- Assisting healthcare professionals with terminology standardization
Limitations
- Primarily trained on German medical terms
- Requires structured input format (Begriff, Einheit, Beschreibung)
- May not cover all edge cases in medical terminology
Training Data
- Custom dataset of German LOINC mappings
- Augmented with synonyms from RELATEDNAMES2
- Chain-of-Thought reasoning examples
Citation
If you use this model, please cite:
@misc{loinc-mapper-2024,
title={LOINC Medical Terminology Mapper},
author={IMESO IT GmbH},
year={2024},
publisher={Hugging Face},
howpublished={\url{Franc105/loinc-mapper}}
}
License
Apache 2.0
Contact
For questions or issues, please open an issue on the model repository.
Model tree for Franc105/loinc-mapper
Base model
meta-llama/Llama-3.2-3B-Instruct Finetuned
unsloth/Llama-3.2-3B-Instruct