Instructions to use HyeonSang/Midm-2.0-KorMedMCQA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HyeonSang/Midm-2.0-KorMedMCQA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HyeonSang/Midm-2.0-KorMedMCQA") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HyeonSang/Midm-2.0-KorMedMCQA") model = AutoModelForCausalLM.from_pretrained("HyeonSang/Midm-2.0-KorMedMCQA", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HyeonSang/Midm-2.0-KorMedMCQA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HyeonSang/Midm-2.0-KorMedMCQA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HyeonSang/Midm-2.0-KorMedMCQA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HyeonSang/Midm-2.0-KorMedMCQA
- SGLang
How to use HyeonSang/Midm-2.0-KorMedMCQA 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 "HyeonSang/Midm-2.0-KorMedMCQA" \ --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": "HyeonSang/Midm-2.0-KorMedMCQA", "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 "HyeonSang/Midm-2.0-KorMedMCQA" \ --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": "HyeonSang/Midm-2.0-KorMedMCQA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HyeonSang/Midm-2.0-KorMedMCQA with Docker Model Runner:
docker model run hf.co/HyeonSang/Midm-2.0-KorMedMCQA
Mi:dm 2.0 Base × KorMedMCQA — BF16 LoRA (merged)
Mi:dm 2.0 Base에 KorMedMCQA 학습 split으로 BF16 LoRA를 학습하고 병합한 모델입니다. 발표의 방법 A(품질 기준선)이며, 방법 B(INT4 PTQ)는 이 가중치를 TorchAO로 양자화해 만듭니다.
PyTorch Day Korea 2026 Serve Track 발표 「작은 모델을 더 작고 빠르게: Unsloth LoRA·TorchAO INT4 QAT부터 vLLM 서빙까지」의 실험 산출물입니다.
의료 조언이 아닙니다. 국가시험 문제 풀이 벤치마크용 연구 산출물입니다. 진단·처방·임상 판단에 쓰지 마세요. 비상업 용도로만 사용할 수 있습니다. 학습 데이터(KorMedMCQA)가 CC BY-NC 2.0입니다.
학습 데이터와 평가
- 데이터:
sean0042/KorMedMCQA— 의사·간호사·약사·치과의사 국가시험 5지선다 (논문) - 학습:
trainsplit (2012–2020년 기출, 3,401문항) - 선택:
devsplit (2021년, 1,059문항) — 프롬프트·step 선택에만 사용 - 평가:
testsplit (2022–2024년, 3,009문항) — 최종 비교에 한 번만 사용 - 정답률 = 모델이 고른 번호가 공식 정답과 같은 비율. 답을 추출하지 못한 응답은 오답으로 셉니다.
학습 기록: backend=hf, n_train=3401, epochs=2.0, global_step=426, train_seconds=1457.6, train_loss=1.8788791172940966, seed=42
결과
vLLM으로 서빙한 상태에서 greedy로 잰 정답률입니다(찍으면 20%, 합격 참고선 60%).
| 모델 | 정답률 (%) | 95% CI | 문항 수 | 답 추출 실패 | 측정 GPU | 엔진 |
|---|---|---|---|---|---|---|
| base | 63.277 | 61.539–64.981 | 3009 | 0 | NVIDIA H100 NVL (Standard_NC40ads_H100_v5) | vllm |
| A_bf16 | 72.316 | 70.69–73.886 | 3009 | 0 | NVIDIA H100 NVL (Standard_NC40ads_H100_v5) | vllm |
사용법
Mi:dm 채팅 템플릿은 KT 시스템 문구와 오늘 날짜를 자동으로 넣습니다. 재현하려면 date_string을 고정하고,
<|eot_id|>(131301)를 정지 토큰으로 지정하고, 체크포인트의 샘플링 기본값(T 0.8 등) 대신 greedy를 쓰세요.
from transformers import AutoTokenizer
from vllm import LLM, SamplingParams
repo = "HyeonSang/Midm-2.0-KorMedMCQA"
tok = AutoTokenizer.from_pretrained(repo)
msgs = [{"role": "system", "content": "보기 중 정답의 번호 하나만 숫자로 출력하세요."},
{"role": "user", "content": "다음은 의사 국가시험 문제입니다. ...\n1. ...\n2. ...\n3. ...\n4. ...\n5. ..."}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True,
date_string="21 Nov 2026")
llm = LLM(repo, dtype="bfloat16", generation_config="vllm")
out = llm.generate([prompt], SamplingParams(temperature=0, max_tokens=16, stop_token_ids=[131301, 2]))
print(out[0].outputs[0].text) # 예: "3"
한계
- 국가시험 기출은 공개 자료라 사전학습 데이터에 섞였을 수 있습니다. 연도별 정답률을 함께 보세요.
- 이미지가 필요한 문항은 데이터셋에 없습니다. 실제 시험의 과목별 과락 기준도 반영하지 않습니다.
라이선스
이 가중치에는 두 가지 조건이 함께 적용됩니다.
- 베이스 모델: Mi:dm 2.0 Base — MIT License, Copyright (c) 2025 KT Corporation. 전문은
LICENSE에 있습니다. - 학습 데이터: KorMedMCQA — CC BY-NC 2.0 (HF 데이터셋 카드 기준). 출처를 표시해야 하고, 학습 데이터 조건에 따라 이 가중치는 비상업 용도로만 사용하세요.
데이터셋 인용: Kweon et al., KorMedMCQA: Multi-Choice Question Answering Benchmark for Korean Healthcare Professional Licensing Examinations (https://arxiv.org/abs/2403.01469).
- Downloads last month
- 29
Model tree for HyeonSang/Midm-2.0-KorMedMCQA
Base model
K-intelligence/Midm-2.0-Base-Instruct