CoolFace
Modelpublic

serhanayberkkilic/qwen3-14b-physiotherapy-lora

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
2likes12downloads
Model Card

Qwen3-14B Physiotherapy Evidence-Based QA (LoRA)

<div align="center">

🏥 A bilingual (English/Turkish) Large Language Model fine-tuned for evidence-based physiotherapy and clinical rehabilitation Q&A

![Model](https://huggingface.co/Qwen/Qwen3-14B) ![Dataset](https://huggingface.co/datasets/serhanayberkkilic/physiotherapy-evidence-qa) ![License](LICENSE)

</div>


📋 Model Overview

This model is a LoRA (Low-Rank Adaptation) fine-tuned version of Qwen3-14B, specifically trained on evidence-based physiotherapy literature. It provides accurate, clinically-relevant answers for physiotherapy and rehabilitation questions in both English and Turkish.

Key Features

FeatureDescription
🌍 BilingualSupports both English and Turkish
📚 Evidence-BasedTrained on peer-reviewed clinical literature
⚡ EfficientLoRA adapter (~500MB) - minimal VRAM with 4-bit quantization
🔬 Clinical FocusSpecialized for physiotherapy and rehabilitation
💬 ConversationalOptimized for Q&A format

🎯 Intended Use Cases

  • —Clinical Decision Support: Evidence-based treatment recommendations
  • —Patient Education: Generating educational content about conditions and treatments
  • —Research Assistance: Literature review and knowledge synthesis
  • —Medical Training: Educational tool for physiotherapy students
  • —Healthcare Applications: Integration into clinical systems and chatbots

📊 Model Specifications

SpecificationValue
Base Modelunsloth/Qwen3-14B
Fine-tuning MethodLoRA (Low-Rank Adaptation)
LoRA Rank (r)32
LoRA Alpha32
Target Modulesqproj, kproj, vproj, oproj, gateproj, upproj, down_proj
Trainable Parameters~1-2% of total
Quantization4-bit (BitsAndBytes NF4)
Max Sequence Length2048 tokens
Training FrameworkUnsloth + TRL + PEFT

📁 Training Data

This model was trained on the [Physiotherapy Evidence QA Dataset](https://huggingface.co/datasets/serhanayberkkilic/physiotherapy-evidence-qa):

StatisticValue
Total Q&A Pairs143,711
Training Conversations~287,422 (EN + TR)
LanguagesEnglish & Turkish
DomainEvidence-based Physiotherapy
SourcesPeer-reviewed clinical literature

Dataset Topics Include:

  • —Musculoskeletal conditions (back pain, joint disorders, etc.)
  • —Neurological rehabilitation
  • —Sports injuries and rehabilitation
  • —Post-surgical rehabilitation
  • —Outcome measures and assessment tools (PRTEE, ODI, etc.)
  • —Therapeutic exercises and interventions
  • —Manual therapy techniques

🚀 Quick Start

Installation

bash
pip install transformers peft accelerate bitsandbytes torch

Inference Code

python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel

# Configuration
base_model_name = "unsloth/qwen3-14b-unsloth-bnb-4bit"
lora_adapter = "serhanayberkkilic/qwen3-14b-physiotherapy-lora"

# 4-bit quantization
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(lora_adapter, trust_remote_code=True)

# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    quantization_config=bnb_config,
    device_map="auto",
    trust_remote_code=True,
)

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, lora_adapter)
model.eval()

# Generate response
def generate(question: str, max_tokens: int = 512):
    messages = [{"role": "user", "content": question}]
    text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(text, return_tensors="pt").to(model.device)
    
    with torch.no_grad():
        outputs = model.generate(
            **inputs,
            max_new_tokens=max_tokens,
            temperature=0.7,
            top_p=0.9,
            do_sample=True,
        )
    
    response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
    return response

# Example usage
question = "What are the evidence-based treatments for chronic low back pain?"
answer = generate(question)
print(answer)

💡 Example Outputs

English Example

Question: What is the PRTEE questionnaire and how is it used?

Answer: The Patient-Rated Tennis Elbow Evaluation (PRTEE) is a validated outcome measure designed to assess pain and functional disability in patients with lateral epicondylitis. It consists of 15 items divided into two subscales: pain (5 items) and function (10 items). The function subscale is further divided into specific and usual activities. Scores range from 0-100, with higher scores indicating greater pain and disability. The PRTEE has demonstrated excellent reliability (ICC > 0.90) and validity for measuring treatment outcomes in lateral epicondylitis...

Turkish Example

Soru: Bel ağrısı için kanıta dayalı fizyoterapi tedavi önerileri nelerdir?

Yanıt: Bel ağrısı tedavisinde kanıta dayalı fizyoterapi yaklaşımları arasında egzersiz terapisi, manuel terapi, hasta eğitimi ve davranışsal yaklaşımlar yer almaktadır. Egzersiz terapisi en güçlü kanıt düzeyine sahip olup, core stabilizasyon egzersizleri, genel kondisyon egzersizleri ve spesifik gövde güçlendirme programları önerilmektedir...


⚙️ Hardware Requirements

ConfigurationVRAM RequiredRecommended GPU
4-bit (Default)~10-12 GBRTX 3090, RTX 4090, A100
8-bit~18-22 GBA100, H100
16-bit (FP16)~28-32 GBA100 80GB, H100

⚠️ Limitations & Disclaimers

Limitations

  • —Not a replacement for clinical judgment: This model should be used as a supportive tool only
  • —Training data cutoff: Knowledge is limited to the training dataset
  • —May generate inaccurate information: Always verify with primary sources
  • —Language quality: Turkish responses may occasionally include English terms

Ethical Considerations

  • —This model is intended for educational and research purposes
  • —Should not be used for direct patient diagnosis or treatment without professional oversight
  • —Users should be aware of potential biases in medical literature

📈 Training Details

Training Configuration

ParameterValue
OptimizerAdamW 8-bit
Learning Rate2e-4
LR SchedulerCosine
Batch SizePer device varies by GPU
Gradient AccumulationAdjusted for effective batch size
Epochs1-2 passes over data
Gradient CheckpointingUnsloth optimized

Training Infrastructure

  • —Hardware: NVIDIA GPU (RTX 4090 / A100)
  • —Framework: Unsloth + HuggingFace TRL + PEFT
  • —Precision: 4-bit quantization (NF4)

📝 Citation

If you use this model in your research, please cite:

bibtex
@misc{kilic2024physiolora,
  author = {Kilic, Serhan Ayberk},
  title = {Qwen3-14B Physiotherapy Evidence-Based QA LoRA},
  year = {2024},
  publisher = {HuggingFace},
  url = {https://huggingface.co/serhanayberkkilic/qwen3-14b-physiotherapy-lora}
}

👤 Author

Serhan Ayberk Kılıç

  • —🤗 HuggingFace: @serhanayberkkilic
  • —📧 Contact: For research collaborations and inquiries

📄 License

This model is released under the Apache 2.0 License. See LICENSE for more details.


🙏 Acknowledgments

  • —Qwen Team for the excellent Qwen3 base model
  • —Unsloth for optimized training framework
  • —HuggingFace for the transformers ecosystem
  • —The physiotherapy research community for evidence-based literature

Framework Versions

  • —PEFT: 0.18.1
  • —Transformers: 4.45.0+
  • —PyTorch: 2.0+
  • —Unsloth: Latest