How to use from
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 "harishnair04/Gemma-medtr-2b-sft" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "harishnair04/Gemma-medtr-2b-sft",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
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 "harishnair04/Gemma-medtr-2b-sft" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "harishnair04/Gemma-medtr-2b-sft",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

Model Card for Medical Transcription Model (Gemma-MedTr)

This model is a fine-tuned variant of Gemma-2-2b, optimized for medical transcription tasks with efficient 4-bit quantization and Low-Rank Adaptation (LoRA). It handles transcription processing, keyword extraction, and medical specialty classification.

Model Details

  • Developed by: Harish Nair
  • Organization: University of Ottawa
  • License: Apache 2.0
  • Fine-tuned from: Gemma-2-2b
  • Model type: Transformer-based language model for medical transcription processing
  • Language(s): English

Training Details

  • Training Loss: Final training loss at step 10: 1.4791
  • Training Configuration:
    • LoRA with r=8, targeting specific transformer modules for adaptation.
    • 4-bit quantization using nf4 quantization type and bfloat16 compute precision.
  • Training Runtime: 20.85 seconds, with approximately 1.92 samples processed per second.

How to Use

To load and use this model, initialize it with the following configuration:

import pandas as pd
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import LoraConfig, PeftModel

model_id = "harishnair04/Gemma-medtr-2b-sft"
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)

tokenizer = AutoTokenizer.from_pretrained(model_id, token=access_token_read)
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_config, device_map='auto', token=access_token_read)
Downloads last month
3
Safetensors
Model size
3B params
Tensor type
F32
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for harishnair04/Gemma-medtr-2b-sft

Quantized
(64)
this model

Dataset used to train harishnair04/Gemma-medtr-2b-sft