Instructions to use RomilY/PCaPLMM_SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RomilY/PCaPLMM_SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RomilY/PCaPLMM_SFT", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("RomilY/PCaPLMM_SFT", trust_remote_code=True, dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RomilY/PCaPLMM_SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RomilY/PCaPLMM_SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RomilY/PCaPLMM_SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RomilY/PCaPLMM_SFT
- SGLang
How to use RomilY/PCaPLMM_SFT 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 "RomilY/PCaPLMM_SFT" \ --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": "RomilY/PCaPLMM_SFT", "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 "RomilY/PCaPLMM_SFT" \ --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": "RomilY/PCaPLMM_SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RomilY/PCaPLMM_SFT with Docker Model Runner:
docker model run hf.co/RomilY/PCaPLMM_SFT
PCaPLMM-SFT
PCaPLMM-SFT: Prostate Cancer Patient Lifestyle Management Model via Supervised Fine-Tuning
Research use only. PCaPLMM-SFT is not a medical device and has not been validated for diagnosis, treatment selection, medication adjustment, emergency triage, or autonomous patient care. Its outputs may be incomplete, outdated, unsupported, or clinically inappropriate. Any health-related output must be reviewed against current clinical guidelines and assessed by qualified healthcare professionals.
仅限科研使用。 PCaPLMM-SFT 不是医疗器械,尚未经过临床诊断、治疗决策、药物调整、急诊分诊或自主患者管理验证。模型可能生成不完整、过时、缺乏证据支持或临床上不恰当的内容。任何健康相关输出均须结合最新临床指南,并由具备资质的医疗专业人员审核。
Model summary
PCaPLMM-SFT is a Chinese–English domain-specific causal language model developed for research on prostate cancer lifestyle-management communication. It was derived from baichuan-inc/Baichuan2-7B-Chat through domain-adaptive training and supervised fine-tuning. The training corpus and instruction data focus on five prespecified domains:
- diet and nutrition;
- physical activity and exercise;
- body-weight management;
- medication and treatment adherence; and
- psychological and psychosocial support.
The associated evidence-retrieval database, FAISS index, source documents, and training datasets are not included in this repository.
中文简介
PCaPLMM-SFT 是一个面向前列腺癌生活方式管理研究的中英文领域化因果语言模型。模型以 Baichuan2-7B-Chat 为基础,经领域继续训练与监督微调构建,主要覆盖饮食营养、体力活动、体重管理、药物或治疗依从性以及心理社会支持五类应用场景。
与研究配套的文献证据库、FAISS 索引、原始文献及训练数据未包含在本仓库中。
Model details
| Item | Description |
|---|---|
| Repository | RomilY/PCaPLMM_SFT |
| Base model | baichuan-inc/Baichuan2-7B-Chat |
| Architecture | Baichuan decoder-only causal language model |
| Approximate scale | 7B parameters |
| Release format | Merged full-model weights, Safetensors |
| Primary task | Bilingual medical-domain text generation |
| Languages | Chinese and English |
| Context limit in the released configuration | 4,096 tokens |
| Training framework | LLaMA-Factory 0.7.0 |
| Parameter-efficient tuning | LoRA, rank 8, bfloat16 |
| Repository code | Custom Baichuan modeling and tokenization code |
| Model-card revision | 11 July 2026 |
The configuration files specify BaichuanForCausalLM, a 4,096-token maximum context length, bfloat16 weights, 32 transformer layers, 32 attention heads, and a hidden size of 4,096. Because this repository includes custom model and tokenizer code, loading requires trust_remote_code=True. Users should inspect the repository code before enabling remote code execution.
Intended uses
Appropriate research uses include:
- studying domain adaptation and supervised fine-tuning for medical language models;
- developing human-supervised prostate cancer education prototypes;
- drafting non-final educational content for expert review;
- evaluating evidence-grounded generation and retrieval-augmented generation workflows;
- studying bilingual communication concerning lifestyle management; and
- comparing model outputs under controlled research protocols.
All generated content should be treated as a draft requiring evidence verification and professional review.
Out-of-scope uses
Do not use this model for:
- diagnosis, prognosis, staging, or treatment selection;
- prescribing, dosing, stopping, or changing medications;
- replacing oncologists, urologists, nurses, pharmacists, dietitians, psychologists, or other qualified professionals;
- emergency advice or triage;
- direct-to-patient deployment without continuous human oversight;
- generating definitive clinical recommendations from model weights alone;
- high-stakes decisions involving an individual patient;
- use as an authoritative clinical guideline; or
- any unlawful, deceptive, discriminatory, or harmful activity.
Training data
Evidence corpus
The documented development corpus covered February 2015 to February 2025 and comprised 2,211 peer-reviewed publications related to prostate cancer lifestyle management:
| Source type | Number |
|---|---|
| Original research articles | 1,516 |
| Review articles | 695 |
| Total | 2,211 |
The literature corpus was processed into more than 150,000 knowledge chunks for evidence organization and retrieval experiments. BGE-M3 embeddings and a FAISS vector store were used in the associated retrieval workflow.
Clinical guideline text was not used as training text. The model therefore must not be assumed to reproduce current guideline recommendations. Users should independently consult current professional guidelines and primary evidence.
Instruction data
| Component | Size | Description |
|---|---|---|
| Single-turn question–answer pairs | 42,330 | Bilingual patient-oriented and knowledge-oriented exchanges grounded in the literature-derived knowledge base |
| Multi-turn conversations | 3,008 | Context-dependent conversations designed to simulate follow-up questions across lifestyle-management scenarios |
In this model card, the instruction data are consistently referred to as the PCaPLMM-SFT instruction dataset.
The five main content domains were diet and nutrition, physical activity, weight management, medication or treatment adherence, and psychological or psychosocial support.
Data generation and quality control
The documented data-development pipeline included:
- literature retrieval and eligibility screening;
- document normalization and evidence chunking;
- semantic embedding with BGE-M3 and storage in FAISS;
- evidence-conditioned question and answer generation;
- formatting, terminology, duplication, consistency, and safety checks;
- similarity-based deduplication;
- grouped splitting at the question-group level to reduce information leakage; and
- stratified human quality review.
Most synthetic question–answer generation used Qwen3-Turbo. Consequently, the instruction data may inherit generator-specific stylistic, factual, and safety-expression biases. A total of 2,400 generated samples underwent human quality review. This audit sample should not be interpreted as proof that the remaining data or model outputs are error-free.
The source publications, generated instruction data, exclusion logs, and quality-control annotations are not distributed in this model repository. Their absence limits independent auditing and exact reconstruction.
Limitations and known risks
Knowledge and temporal limitations
- The documented evidence corpus ended in February 2025. The model may not reflect evidence, safety communications, drug information, or guidelines published after that date.
- The model does not dynamically retrieve new evidence unless integrated into an external retrieval system.
- Published literature can contain bias, reporting errors, contradictory findings, and limited population coverage.
- Review articles and original studies were included, but guideline text was not used as training text.
Generation limitations
- The model can hallucinate references, statistics, mechanisms, contraindications, or recommendations.
- It may present uncertain evidence with unjustified confidence.
- It may fail to distinguish population-level associations from individual clinical advice.
- It may generate generic recommendations that do not account for cancer stage, treatment modality, comorbidities, frailty, culture, access, or patient preferences.
- It may inconsistently communicate uncertainty, contraindications, and thresholds for professional referral.
- Output quality may differ between Chinese and English and across prompt styles.
- The model may reproduce biases from the base model, publication corpus, synthetic-data generator, and human reviewers.
Retrieval limitations
The associated study used a retrieval-augmented workflow with BGE-M3 embeddings, FAISS, and a top-k value of 20. Those components are not bundled here. Running the released model without retrieval should not be described as evidence-grounded generation. Even with retrieval, users must verify that the retrieved evidence is relevant, current, and correctly interpreted.
Safety limitations
The model was not prospectively evaluated in real patients, clinical workflows, or randomized implementation studies. It should not be exposed directly to patients without an institutionally approved protocol, privacy safeguards, continuous professional oversight, output logging, and a clear escalation pathway.
How to use
Installation
A reproducible starting environment is:
pip install "torch>=2.0" "transformers==4.48.3" accelerate sentencepiece safetensors
The repository contains custom code. Review configuration_baichuan.py, modeling_baichuan.py, tokenization_baichuan.py, generation_utils.py, and quantizer.py before setting trust_remote_code=True.
Basic chat inference
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
GenerationConfig,
)
MODEL_ID = "RomilY/PCaPLMM_SFT"
tokenizer = AutoTokenizer.from_pretrained(
MODEL_ID,
use_fast=False,
trust_remote_code=True,
)
model_kwargs = {
"trust_remote_code": True,
"torch_dtype": torch.bfloat16 if torch.cuda.is_available() else torch.float32,
}
if torch.cuda.is_available():
model_kwargs["device_map"] = "auto"
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
**model_kwargs,
)
model.generation_config = GenerationConfig.from_pretrained(MODEL_ID)
model.eval()
messages = [
{
"role": "user",
"content": (
"前列腺癌患者在开始新的运动计划前,需要考虑哪些因素?"
"请区分一般健康教育与必须咨询临床医生的情况。"
),
}
]
with torch.inference_mode():
response = model.chat(tokenizer, messages)
print(response)
Multi-turn inference
messages = [
{
"role": "user",
"content": "前列腺癌治疗期间,怎样制定较安全的日常活动计划?",
}
]
with torch.inference_mode():
first_response = model.chat(tokenizer, messages)
messages.append({"role": "assistant", "content": first_response})
messages.append(
{
"role": "user",
"content": "如果患者同时存在骨转移风险,哪些建议不能直接照搬?",
}
)
with torch.inference_mode():
second_response = model.chat(tokenizer, messages)
print(second_response)
Download with Git
The repository contains approximately 15 GB of model files.
git lfs install
git clone https://huggingface.co/RomilY/PCaPLMM_SFT
Generation configuration
The repository's default generation_config.json specifies:
| Parameter | Default |
|---|---|
do_sample |
true |
temperature |
0.3 |
top_p |
0.85 |
top_k |
5 |
repetition_penalty |
1.05 |
max_new_tokens |
2048 |
These values are release defaults rather than clinically validated settings. For research requiring greater repeatability, explicitly set a random seed and document all generation parameters. Low-temperature decoding does not eliminate hallucinations.
Hardware considerations
The sharded bfloat16 weights occupy approximately 15 GB on disk. Runtime memory also includes model-loading overhead, activations, the key–value cache, and framework allocations. Hardware requirements therefore depend on input length, output length, batch size, precision, and device mapping. CPU inference is possible in principle but may be slow. The repository does not provide a validated quantized release.
Repository contents
The current release includes the following principal files:
PCaPLMM_SFT/
├── README.md
├── config.json
├── configuration.json
├── configuration_baichuan.py
├── generation_config.json
├── generation_utils.py
├── model-00001-of-00004.safetensors
├── model-00002-of-00004.safetensors
├── model-00003-of-00004.safetensors
├── model-00004-of-00004.safetensors
├── model.safetensors.index.json
├── modeling_baichuan.py
├── Modelfile
├── quantizer.py
├── special_tokens_map.json
├── tokenization_baichuan.py
├── tokenizer.model
└── tokenizer_config.json
Responsible-use recommendations
Research deployments should, at minimum:
- use retrieval from current and curated evidence rather than relying only on parametric memory;
- retain source metadata and display evidence provenance;
- require human review before any content reaches patients;
- implement checks for unsupported claims, medication advice, contraindications, and emergency symptoms;
- preserve prompts, retrieved passages, model versions, generation settings, and reviewer decisions for audit;
- conduct subgroup and language-specific evaluation;
- prohibit the entry of identifiable patient information unless an approved privacy and security framework is in place; and
- define a process for updating or withdrawing the model when evidence or safety requirements change.
License
This derivative model is subject to the terms applicable to the Baichuan 2 base model. Community use requires compliance with both the Apache License 2.0 and the Baichuan 2 Model Community License. Commercial use may require additional authorization and remains subject to the base model's terms.
Before use or redistribution, review:
Nothing in this model card grants rights beyond those provided by the applicable licenses.
Citation
The associated manuscript citation should replace the provisional repository citation below once the article is publicly available.
@misc{pcaplmm_sft_2026,
title = {PCaPLMM-SFT: Prostate Cancer Patient Lifestyle Management Model via Supervised Fine-Tuning},
author = {{PCaPLMM-SFT Development Team}},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/RomilY/PCaPLMM_SFT}},
note = {Research model; accessed YYYY-MM-DD}
}
Acknowledgements
This work builds on:
Contact
Repository maintainer: Fangyuan Jiang
Email: theromily@gmail.com
For reproducibility questions, suspected safety issues, or documentation corrections, open a discussion in the Hugging Face repository or contact the maintainer.
Change log
Model-card revision — 11 July 2026
- updated inference examples to use the model's custom Baichuan code and chat interface;
- corrected the repository description from a standalone LoRA adapter to merged full-model weights;
- aligned the file tree with the files currently present in the repository;
- clarified that clinical guideline text was not used as training text;
- added intended-use, out-of-scope-use, limitation, bias, safety, licensing, and reproducibility sections; and
- added Hugging Face metadata for task, library, languages, base model, license, and discoverability.
- Downloads last month
- 593
Model tree for RomilY/PCaPLMM_SFT
Base model
baichuan-inc/Baichuan2-7B-Chat