RomilY commited on
Commit
87e4df4
ยท
verified ยท
1 Parent(s): 39fae4b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +383 -58
README.md CHANGED
@@ -1,98 +1,423 @@
1
  ---
2
- license: apache-2.0
3
  language:
4
- - zh
5
- - en
6
- tasks:
7
- - text-generation
8
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
- # PCaPLMM_SFT: A Prostate Cancer Patient Lifestyle Management Model via Supervised Fine-Tuning
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- ## ๐Ÿ“„ ้กน็›ฎ็ฎ€ไป‹
14
 
15
- PCaPLMM_SFT ๆ˜ฏไธ€ไธชๅŸบไบŽ Baichuan2-7B-chat ๅบ”็”จ LoRA ๅพฎ่ฐƒ็ป LLaMA-Factory ๆžถๆž„่ฎญ็ปƒ่€Œๆˆ็š„ไธญ่‹ฑๆ–‡ๅŒปๅญฆๅฏน่ฏ็”Ÿๆˆๆจกๅž‹ใ€‚ๅฎƒ้ขๅ‘ๅ‰ๅˆ—่…บ็™Œๆ‚ฃ่€…็š„็”Ÿๆดปๆ–นๅผ็ฎก็†้œ€ๆฑ‚๏ผŒๅฑ•็Žฐไบ†่ŒไธšๅŒปๅญฆ็Ÿฅ่ฏ†ๅ’Œไบบๆ–‡ๅ…ณๆ€€็š„็ป„ๅˆๆ€งไบคไบ’็‰นๅพใ€‚
16
 
17
- ## ๐Ÿค– ๅŸบ็ก€ๆจกๅž‹ไฟกๆฏ
18
 
19
- - ๅŸบ็ก€ๆจกๅž‹๏ผšBaichuan2-7B-Chat
20
- - ๅพฎ่ฐƒๆ–นๅผ๏ผšLoRA (rank=8, ไฝฟ็”จ bf16)
21
- - ่ฎญ็ปƒๆžถๆž„๏ผšLLaMA-Factory (v0.7.0)
22
- - ่ฎญ็ปƒๆ•ฐๆฎ๏ผšๅŸบไบŽ็ณป็ปŸ็บณๅ…ฅ็š„2211็ฏ‡ๆ–‡็Œฎๆž„ๅปบไบ†้ขๅ‘ๅ‰ๅˆ—่…บ็™Œ็”Ÿๆดปๆ–นๅผๅœบๆ™ฏ็š„่ฎญ็ปƒๆ•ฐๆฎ้›†๏ผŒๅŒ…ๆ‹ฌ่ฅๅ…ป็ฎก็†ใ€ไฝ“ๅŠ›ๆดปๅŠจใ€ไฝ“้‡็ฎกๆŽงใ€่ฏ็‰ฉไปŽๅฎžๆ€งใ€ๅฟƒ็†ๆ”ฏๆŒ็ญ‰ๅœบๆ™ฏ
23
- ่กจ MedLIFE-Pca-Trainๆ•ฐๆฎ้›†็š„ๆ•ฐๆฎๆž„ๆˆ
24
- |ๆ•ฐๆฎ้›†ๅ็งฐ |็ฑปๅž‹ๆ•ฐๆฎ้‡ | ๆ่ฟฐ |
25
- |้ข„่ฎญ็ปƒๆ•ฐๆฎ้›† |ๆ–‡ๆœฌๆ•ฐๆฎ |2211 ็ฏ‡ๆ–‡็Œฎ ๅŒ…ๅซ 1516 ็ฏ‡ๅŽŸๅˆ›ๆ€ง็ ”็ฉถๆ–‡็ซ ๅ’Œ695็ฏ‡ไธŽๅ‰ๅˆ—่…บ็™Œ็”Ÿๆดปๆ–นๅผ็›ธๅ…ณ็š„็ปผ่ฟฐ๏ผŒ็”จไบŽ้ข†ๅŸŸ็ปง็ปญ้ข„่ฎญ็ปƒ |
26
- |ๅ•่ฝฎๅฏน่ฏๆ•ฐๆฎ้›† |ๅŒป็–—ๅฏน่ฏ |42,670 ็ป„ ๅŸบไบŽ็Ÿฅ่ฏ†ๅบ“็”Ÿๆˆ็š„ๅ•่ฝฎๆ‚ฃ่€…้—ฎ็ญ”๏ผŒ่ฆ†็›–้ฅฎ้ฃŸ่ฅๅ…ปใ€ไฝ“ๅŠ›ๆดปๅŠจใ€ไฝ“้‡็ฎก็†ใ€ๅฟƒ็†ๆ”ฏๆŒใ€่ฏ็‰ฉไพไปŽ็ญ‰ไธป้ข˜ |
27
- |ๅคš่ฝฎๅฏน่ฏๆ•ฐๆฎ้›† |ๅคš่ฝฎๅŒป็–—ๅฏน่ฏ| 3,008 ็ป„ ็ป“ๅˆไธŠไธ‹ๆ–‡่ฏญๅขƒๆ‰ฉๅฑ•็”Ÿๆˆ็š„่ฟž็ปญ้—ฎ็ญ”ๆ•ฐๆฎ๏ผŒๆจกๆ‹Ÿๆ‚ฃ่€…ๅœจ็”Ÿๆดปๆ–นๅผ็ฎก็†่ฟ‡็จ‹ไธญ็š„ๅคš่ฝฎไบ’ๅŠจๆƒ…ๅขƒ |
28
-
29
 
 
 
 
 
 
 
30
 
 
31
 
 
32
 
 
33
 
34
- > ๆณจ๏ผšๆ นๆฎ้šๆœบๆŠฝๆ ท50ๆก้—ฎ็ญ”ๅฏน่ฟ›่กŒไบบๅทฅ่ฏ„ๅˆ†
35
 
36
- ## ๐Ÿ“š ่ฎญ็ปƒๆ•ฐๆฎ็”Ÿๆˆๆต็จ‹
37
 
38
- ๅฐ†ๅทฒ็”Ÿๆˆ็š„้—ฎ้ข˜ๅ’ŒๅŒบๅŸŸๅŒ–็Ÿฅ่ฏ†็‰‡ๆฎต่ฟ›่กŒ prompt ๆ‹ผๆŽฅ๏ผŒ้€š่ฟ‡ๆจกๅž‹็”Ÿๆˆ็ป™ๅ‡บ็ญ”ๆกˆใ€‚็”Ÿๆˆ่ฟ›็จ‹ไธญๆจกๅž‹่ขซๆŒ‡็คบไผ˜ๅ…ˆๅผ•็”จไธ“ไธšๆœฏ่ฏญๅ’ŒๆŒ‡ๅ—ๆ„่ง๏ผŒๅนถๆธ…ๆ™ฐๆ ‡ๆ˜Ž็Ÿฅ่ฏ†ๆฅๆบ๏ผŒไปฅ็กฎไฟ็ญ”ๆกˆ็š„ๅŒปๅญฆๅ‡†็กฎๆ€งใ€ๅฏ่งฃ้‡Šๆ€งๅ’ŒไธŠไธ‹ๆ–‡่ฟž่ฐฑๆ€งใ€‚
 
 
 
 
 
39
 
40
- ๆ‰€ๆœ‰้—ฎ็ญ”ๅฏน้€š่ฟ‡็ปŸไธ€ JSON ๆ ผๅผไฟๅญ˜๏ผŒ็”จไบŽไฝœไธบ็›ธๅŒ็ฑปๅž‹็š„็›ˆๅพ—ๅฏผๅ…ฅ๏ผŒไฟ่ฏๆ ผๅผ็ปŸไธ€ใ€็ป„็ป‡็จ‹ๅบฆ้ซ˜ใ€ๅฏ้‡ๅคๆ€งๅผบใ€‚
41
 
42
- ๅŒๆ—ถ๏ผŒไธบไบ†ไฟ้šœ่ฎญ็ปƒๆ•ฐๆฎ็š„่ดจ้‡ไธŽๅฎ‰ๅ…จ๏ผŒๅผ•ๅ…ฅไบบๅทฅ่ฏ„ไผฐๆœบๅˆถๅฏน้ƒจๅˆ†ๆ ทๆœฌ่ฟ›่กŒๆฃ€ๆŸฅ๏ผŒๅนถ้€š่ฟ‡ๅ…ณ้”ฎๆœฏ่ฏญ่ฟๆธกๅ’Œๆ ผๅผๆ ก้ชŒ่ง„ๅˆ™ๅˆ ้™คๅญ˜ๅœจๅŒปๅญฆ่ฏฏๅทฎใ€้€ป่พ‘็Ÿ›็›พๆˆ–่ฏญ่จ€ๅผ‚ๅธธ็š„้—ฎ็ญ”ๅฏนใ€‚
 
 
 
 
 
 
 
 
43
 
44
- ## ๐Ÿ“‚ ๆ–‡ไปถ็ป“ๆž„
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ```
47
- โ”œโ”€โ”€ adapter_model.bin # LoRA ๅพฎ่ฐƒๆƒ้‡
48
- โ”œโ”€โ”€ config.json # ๆจกๅž‹้…็ฝฎๆ–‡ไปถ
49
- โ”œโ”€โ”€ tokenizer_config.json # ๅˆ†่ฏๅ™จ้…็ฝฎ
50
- โ”œโ”€โ”€ special_tokens_map.json # ็‰นๆฎŠ็ฌฆๅทๆ˜ ๅฐ„
51
- โ”œโ”€โ”€ README.md # ่ฏฆ็ป†่ฏดๆ˜Ž
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ```
53
 
54
- ## ๐Ÿ”ง ไฝฟ็”จ็คบไพ‹
55
 
56
  ```python
57
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- model = AutoModelForCausalLM.from_pretrained("your-username/PCaPLMM_SFT")
60
- tokenizer = AutoTokenizer.from_pretrained("your-username/PCaPLMM_SFT")
 
 
61
 
62
- prompt = "ๅ‰ๅˆ—่…บ็™Œๆ‚ฃ่€…ๆ˜ฏๅฆๅฏไปฅ่ฟๅŠจ๏ผŸ"
63
- inputs = tokenizer(prompt, return_tensors="pt")
64
- outputs = model.generate(**inputs, max_new_tokens=512)
65
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  ```
67
 
68
- ## ๐Ÿšซ ไฝฟ็”จ้™ๅˆถ
69
 
70
- - ๆœฌๆจกๅž‹ไป…็”จไบŽ็ง‘็ ”ไธŽๆ•™ๅญฆ็›ธๅ…ณๅœบๆ™ฏ๏ผŒไธๅบ”็”จไบŽๅฎž้™…ๅŒป็–—่ฏŠๆ–ญๆˆ–ๅ€กๅฏผ
71
- - ๅฆ‚้œ€ๅ•†ไธšๅŒ–ไฝฟ็”จ๏ผŒ่ฏท่”็ณป้กน็›ฎ่ดŸ่ดฃไบบ
72
 
73
- ## ๐Ÿ“ง ่”็ณปๆ–นๅผ
 
 
 
 
 
 
 
74
 
75
- - ้กน็›ฎ่ดŸ่ดฃไบบ๏ผš[Fangyuan Jiang\_theromily@gmail.com]
76
- - ๆ‰€ๅฑžๅ•ไฝ๏ผšๅ—้€šๅคงๅญฆๅŒปๅญฆ้™ข
77
 
78
- ## ๐ŸŒŸ ่‡ด่ฐข
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
- - [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)
81
  - [Baichuan2-7B-Chat](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat)
 
 
 
82
 
83
- ## ๅ่ฎฎ
84
 
85
- ็คพๅŒบไฝฟ็”จ Baichuan 2 ๆจกๅž‹้œ€่ฆ้ตๅพช [Apache 2.0](https://github.com/baichuan-inc/Baichuan2/blob/main/LICENSE) ๅ’Œ[ใ€ŠBaichuan 2 ๆจกๅž‹็คพๅŒบ่ฎธๅฏๅ่ฎฎใ€‹](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/resolve/main/Baichuan%202%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf)ใ€‚Baichuan 2 ๆจกๅž‹ๆ”ฏๆŒๅ•†ไธš็”จ้€”๏ผŒๅฆ‚ๆžœๆ‚จ่ฎกๅˆ’ๅฐ† Baichuan 2 ๆจกๅž‹ๆˆ–ๅ…ถ่ก็”Ÿๅ“็”จไบŽๅ•†ไธš็›ฎ็š„๏ผŒ่ฏทๆ‚จ็กฎ่ฎคๆ‚จ็š„ไธปไฝ“็ฌฆๅˆไปฅไธ‹ๆƒ…ๅ†ต๏ผš
86
- 1. ๆ‚จๆˆ–ๆ‚จ็š„ๅ…ณ่”ๆ–น็š„ๆœๅŠกๆˆ–ไบงๅ“็š„ๆ—ฅๅ‡็”จๆˆทๆดป่ทƒ้‡๏ผˆDAU๏ผ‰ไฝŽไบŽ100ไธ‡ใ€‚
87
- 2. ๆ‚จๆˆ–ๆ‚จ็š„ๅ…ณ่”ๆ–นไธๆ˜ฏ่ฝฏไปถๆœๅŠกๆไพ›ๅ•†ใ€ไบ‘ๆœๅŠกๆไพ›ๅ•†ใ€‚
88
- 3. ๆ‚จๆˆ–ๆ‚จ็š„ๅ…ณ่”ๆ–นไธๅญ˜ๅœจๅฐ†ๆŽˆไบˆๆ‚จ็š„ๅ•†็”จ่ฎธๅฏ๏ผŒๆœช็ป็™พๅท่ฎธๅฏไบŒๆฌกๆŽˆๆƒ็ป™ๅ…ถไป–็ฌฌไธ‰ๆ–น็š„ๅฏ่ƒฝใ€‚
89
 
90
- ๅœจ็ฌฆๅˆไปฅไธŠๆกไปถ็š„ๅ‰ๆไธ‹๏ผŒๆ‚จ้œ€่ฆ้€š่ฟ‡ไปฅไธ‹่”็ณป้‚ฎ็ฎฑ opensource@baichuan-inc.com ๏ผŒๆไบคใ€ŠBaichuan 2 ๆจกๅž‹็คพๅŒบ่ฎธๅฏๅ่ฎฎใ€‹่ฆๆฑ‚็š„็”ณ่ฏทๆๆ–™ใ€‚ๅฎกๆ ธ้€š่ฟ‡ๅŽ๏ผŒ็™พๅทๅฐ†็‰นๆญคๆŽˆไบˆๆ‚จไธ€ไธช้žๆŽ’ไป–ๆ€งใ€ๅ…จ็ƒๆ€งใ€ไธๅฏ่ฝฌ่ฎฉใ€ไธๅฏๅ†่ฎธๅฏใ€ๅฏๆ’ค้”€็š„ๅ•†็”จ็‰ˆๆƒ่ฎธๅฏใ€‚
91
 
92
- The community usage of Baichuan 2 model requires adherence to [Apache 2.0](https://github.com/baichuan-inc/Baichuan2/blob/main/LICENSE) and [Community License for Baichuan2 Model](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/resolve/main/Baichuan%202%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf). The Baichuan 2 model supports commercial use. If you plan to use the Baichuan 2 model or its derivatives for commercial purposes, please ensure that your entity meets the following conditions:
93
 
94
- 1. The Daily Active Users (DAU) of your or your affiliate's service or product is less than 1 million.
95
- 2. Neither you nor your affiliates are software service providers or cloud service providers.
96
- 3. There is no possibility for you or your affiliates to grant the commercial license given to you, to reauthorize it to other third parties without Baichuan's permission.
97
 
98
- Upon meeting the above conditions, you need to submit the application materials required by the Baichuan 2 Model Community License Agreement via the following contact email: opensource@baichuan-inc.com. Once approved, Baichuan will hereby grant you a non-exclusive, global, non-transferable, non-sublicensable, revocable commercial copyright license.
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  language:
3
+ - zh
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ base_model: baichuan-inc/Baichuan2-7B-Chat
8
+ license: other
9
+ license_name: "apache-2.0"
10
+ tags:
11
+ - baichuan
12
+ - custom_code
13
+ - safetensors
14
+ - medical
15
+ - healthcare
16
+ - prostate-cancer
17
+ - lifestyle-management
18
+ - patient-education
19
+ - domain-specific
20
+ - supervised-fine-tuning
21
+ - lora
22
+ - bilingual
23
  ---
24
 
25
+ # PCaPLMM-SFT
26
+
27
+ **PCaPLMM-SFT: A Bilingual Domain-Specific Language Model for Prostate Cancer Lifestyle Management**
28
+
29
+ > [!CAUTION]
30
+ > **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.
31
+ >
32
+ > **ไป…้™็ง‘็ ”ไฝฟ็”จใ€‚** PCaPLMM-SFT ไธๆ˜ฏๅŒป็–—ๅ™จๆขฐ๏ผŒๅฐšๆœช็ป่ฟ‡ไธดๅบŠ่ฏŠๆ–ญใ€ๆฒป็–—ๅ†ณ็ญ–ใ€่ฏ็‰ฉ่ฐƒๆ•ดใ€ๆ€ฅ่ฏŠๅˆ†่ฏŠๆˆ–่‡ชไธปๆ‚ฃ่€…็ฎก็†้ชŒ่ฏใ€‚ๆจกๅž‹ๅฏ่ƒฝ็”ŸๆˆไธๅฎŒๆ•ดใ€่ฟ‡ๆ—ถใ€็ผบไน่ฏๆฎๆ”ฏๆŒๆˆ–ไธดๅบŠไธŠไธๆฐๅฝ“็š„ๅ†…ๅฎนใ€‚ไปปไฝ•ๅฅๅบท็›ธๅ…ณ่พ“ๅ‡บๅ‡้กป็ป“ๅˆๆœ€ๆ–ฐไธดๅบŠๆŒ‡ๅ—๏ผŒๅนถ็”ฑๅ…ทๅค‡่ต„่ดจ็š„ๅŒป็–—ไธ“ไธšไบบๅ‘˜ๅฎกๆ ธใ€‚
33
+
34
+ ## Model summary
35
+
36
+ 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`](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat) through domain-adaptive training and supervised fine-tuning. The training corpus and instruction data focus on five prespecified domains:
37
+
38
+ 1. diet and nutrition;
39
+ 2. physical activity and exercise;
40
+ 3. body-weight management;
41
+ 4. medication and treatment adherence; and
42
+ 5. psychological and psychosocial support.
43
+
44
+ This repository releases **merged full-model weights** in the Safetensors format. It does not contain only a standalone LoRA adapter. The associated evidence-retrieval database, FAISS index, source documents, and training datasets are not included in this repository.
45
+
46
+ ### ไธญๆ–‡็ฎ€ไป‹
47
+
48
+ PCaPLMM-SFT ๆ˜ฏไธ€ไธช้ขๅ‘ๅ‰ๅˆ—่…บ็™Œ็”Ÿๆดปๆ–นๅผ็ฎก็†็ ”็ฉถ็š„ไธญ่‹ฑๆ–‡้ข†ๅŸŸๅŒ–ๅ› ๆžœ่ฏญ่จ€ๆจกๅž‹ใ€‚ๆจกๅž‹ไปฅ Baichuan2-7B-Chat ไธบๅŸบ็ก€๏ผŒ็ป้ข†ๅŸŸ็ปง็ปญ่ฎญ็ปƒไธŽ็›‘็ฃๅพฎ่ฐƒๆž„ๅปบ๏ผŒไธป่ฆ่ฆ†็›–้ฅฎ้ฃŸ่ฅๅ…ปใ€ไฝ“ๅŠ›ๆดปๅŠจใ€ไฝ“้‡็ฎก็†ใ€่ฏ็‰ฉๆˆ–ๆฒป็–—ไพไปŽๆ€งไปฅๅŠๅฟƒ็†็คพไผšๆ”ฏๆŒไบ”็ฑปๅบ”็”จๅœบๆ™ฏใ€‚
49
+
50
+ ๆœฌไป“ๅบ“ๅ‘ๅธƒ็š„ๆ˜ฏ **ๅˆๅนถๅŽ็š„ๅฎŒๆ•ดๆจกๅž‹ๆƒ้‡**๏ผŒ่€Œไธๆ˜ฏไป…ๅŒ…ๅซ LoRA ้€‚้…ๅ™จ็š„ไป“ๅบ“ใ€‚ไธŽ็ ”็ฉถ้…ๅฅ—็š„ๆ–‡็Œฎ่ฏๆฎๅบ“ใ€FAISS ็ดขๅผ•ใ€ๅŽŸๅง‹ๆ–‡็ŒฎๅŠ่ฎญ็ปƒๆ•ฐๆฎๆœชๅŒ…ๅซๅœจๆœฌไป“ๅบ“ไธญใ€‚
51
+
52
+ ## Model details
53
+
54
+ | Item | Description |
55
+ |---|---|
56
+ | Repository | [`RomilY/PCaPLMM_SFT`](https://huggingface.co/RomilY/PCaPLMM_SFT) |
57
+ | Base model | [`baichuan-inc/Baichuan2-7B-Chat`](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat) |
58
+ | Architecture | Baichuan decoder-only causal language model |
59
+ | Approximate scale | 7B parameters |
60
+ | Release format | Merged full-model weights, Safetensors |
61
+ | Primary task | Bilingual medical-domain text generation |
62
+ | Languages | Chinese and English |
63
+ | Context limit in the released configuration | 4,096 tokens |
64
+ | Training framework | LLaMA-Factory 0.7.0 |
65
+ | Parameter-efficient tuning | LoRA, rank 8, bfloat16 |
66
+ | Repository code | Custom Baichuan modeling and tokenization code |
67
+ | Model-card revision | 11 July 2026 |
68
+
69
+ 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.
70
+
71
+ ## Intended uses
72
+
73
+ Appropriate research uses include:
74
+
75
+ - studying domain adaptation and supervised fine-tuning for medical language models;
76
+ - developing human-supervised prostate cancer education prototypes;
77
+ - drafting non-final educational content for expert review;
78
+ - evaluating evidence-grounded generation and retrieval-augmented generation workflows;
79
+ - studying bilingual communication concerning lifestyle management; and
80
+ - comparing model outputs under controlled research protocols.
81
+
82
+ All generated content should be treated as a draft requiring evidence verification and professional review.
83
+
84
+ ## Out-of-scope uses
85
+
86
+ Do not use this model for:
87
+
88
+ - diagnosis, prognosis, staging, or treatment selection;
89
+ - prescribing, dosing, stopping, or changing medications;
90
+ - replacing oncologists, urologists, nurses, pharmacists, dietitians, psychologists, or other qualified professionals;
91
+ - emergency advice or triage;
92
+ - direct-to-patient deployment without continuous human oversight;
93
+ - generating definitive clinical recommendations from model weights alone;
94
+ - high-stakes decisions involving an individual patient;
95
+ - use as an authoritative clinical guideline; or
96
+ - any unlawful, deceptive, discriminatory, or harmful activity.
97
+
98
+ ## Training data
99
+
100
+ ### Evidence corpus
101
+
102
+ The documented development corpus covered **February 2015 to February 2025** and comprised **2,211 peer-reviewed publications** related to prostate cancer lifestyle management:
103
+
104
+ | Source type | Number |
105
+ |---|---:|
106
+ | Original research articles | 1,516 |
107
+ | Review articles | 695 |
108
+ | **Total** | **2,211** |
109
+
110
+ 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.
111
+
112
+ **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.
113
+
114
+ ### Instruction data
115
+
116
+ | Component | Size | Description |
117
+ |---|---:|---|
118
+ | Single-turn questionโ€“answer pairs | **42,330** | Bilingual patient-oriented and knowledge-oriented exchanges grounded in the literature-derived knowledge base |
119
+ | Multi-turn conversations | **3,008** | Context-dependent conversations designed to simulate follow-up questions across lifestyle-management scenarios |
120
+
121
+ In this model card, the instruction data are consistently referred to as the **PCaPLMM-SFT instruction dataset**.
122
+
123
+ The five main content domains were diet and nutrition, physical activity, weight management, medication or treatment adherence, and psychological or psychosocial support.
124
+
125
+ ### Data generation and quality control
126
+
127
+ The documented data-development pipeline included:
128
+
129
+ 1. literature retrieval and eligibility screening;
130
+ 2. document normalization and evidence chunking;
131
+ 3. semantic embedding with BGE-M3 and storage in FAISS;
132
+ 4. evidence-conditioned question and answer generation;
133
+ 5. formatting, terminology, duplication, consistency, and safety checks;
134
+ 6. similarity-based deduplication;
135
+ 7. grouped splitting at the question-group level to reduce information leakage; and
136
+ 8. stratified human quality review.
137
 
138
+ 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.
139
 
140
+ 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.
141
 
142
+ ## Training procedure
143
 
144
+ PCaPLMM-SFT was produced using a staged domain-adaptation workflow.
 
 
 
 
 
 
 
 
 
145
 
146
+ | Stage | Main configuration |
147
+ |---|---|
148
+ | Domain-adaptive continual pretraining | Maximum sequence length 2,048; AdamW; learning rate approximately `2e-4`; 3โ€“5 epochs |
149
+ | Supervised fine-tuning | Maximum sequence length 1,024; AdamW; learning rate approximately `2e-5`; 3 epochs |
150
+ | Parameter-efficient adaptation | LoRA rank 8; approximately 17.89 million trainable parameters; bfloat16 |
151
+ | Release preparation | LoRA-adapted weights merged into the full base model and saved as sharded Safetensors |
152
 
153
+ The released configuration supports up to 4,096 tokens, but the documented training sequence lengths were shorter. The model card therefore does not claim validated long-context performance at the full configuration limit.
154
 
155
+ ### Compute and environmental reporting
156
 
157
+ Training hardware, wall-clock time, energy consumption, and carbon emissions are not reported in the current public release. This limits exact computational reproduction and environmental-impact assessment.
158
 
159
+ ## Evaluation
160
 
161
+ The associated study evaluated model responses across the five lifestyle-management domains. Evaluation dimensions included:
162
 
163
+ - evidence consistency;
164
+ - comprehensibility;
165
+ - relevance;
166
+ - empathy or patient-centeredness;
167
+ - feasibility of the suggested actions; and
168
+ - safety-related failure signals.
169
 
170
+ The evaluation used two large-language-model judges, Qwen3-Max and DeepSeek-R1, in two blinded rounds, together with a smaller human-expert assessment.
171
 
172
+ | Evaluation component | Reported design or result |
173
+ |---|---|
174
+ | Automated judging | Qwen3-Max and DeepSeek-R1; two blinded rounds |
175
+ | Between-judge agreement | ICC(3,k) approximately 0.689 |
176
+ | Repeat-run association | Pearson correlation approximately 0.690 |
177
+ | Human assessment | Three experts evaluated 50 cases, with 10 cases from each lifestyle domain |
178
+ | Human inter-rater agreement | ICC approximately 0.332โ€“0.431 |
179
+ | Humanโ€“LLM-judge agreement | ICC approximately 0.474; 95% CI 0.410โ€“0.530 |
180
+ | Instruction-data quality review | Two-rater ICC(3,k) approximately 0.780; weighted kappa approximately 0.812 |
181
 
182
+ In the reported judge-based comparisons, PCaPLMM-SFT generally showed stronger evidence-oriented performance than the Baichuan2-7B-Chat base model and GPT-3.5 in several domains. However, effect sizes varied by judge, scenario, and evaluation dimension.
183
 
184
+ These findings are **research evaluation results**, not evidence of clinical effectiveness, clinical safety, improved patient outcomes, or regulatory-grade validation. The modest human inter-rater and humanโ€“LLM agreement estimates also indicate that model-judge scores should not be treated as a substitute for expert assessment.
185
+
186
+ ## Limitations and known risks
187
+
188
+ ### Knowledge and temporal limitations
189
+
190
+ - The documented evidence corpus ended in **February 2025**. The model may not reflect evidence, safety communications, drug information, or guidelines published after that date.
191
+ - The model does not dynamically retrieve new evidence unless integrated into an external retrieval system.
192
+ - Published literature can contain bias, reporting errors, contradictory findings, and limited population coverage.
193
+ - Review articles and original studies were included, but guideline text was not used as training text.
194
+
195
+ ### Generation limitations
196
+
197
+ - The model can hallucinate references, statistics, mechanisms, contraindications, or recommendations.
198
+ - It may present uncertain evidence with unjustified confidence.
199
+ - It may fail to distinguish population-level associations from individual clinical advice.
200
+ - It may generate generic recommendations that do not account for cancer stage, treatment modality, comorbidities, frailty, culture, access, or patient preferences.
201
+ - It may inconsistently communicate uncertainty, contraindications, and thresholds for professional referral.
202
+ - Output quality may differ between Chinese and English and across prompt styles.
203
+ - The model may reproduce biases from the base model, publication corpus, synthetic-data generator, and human reviewers.
204
+
205
+ ### Retrieval limitations
206
+
207
+ 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.
208
+
209
+ ### Safety limitations
210
+
211
+ 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.
212
+
213
+ ## How to use
214
+
215
+ ### Installation
216
+
217
+ A reproducible starting environment is:
218
+
219
+ ```bash
220
+ pip install "torch>=2.0" "transformers==4.48.3" accelerate sentencepiece safetensors
221
  ```
222
+
223
+ 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`.
224
+
225
+ ### Basic chat inference
226
+
227
+ ```python
228
+ import torch
229
+ from transformers import (
230
+ AutoModelForCausalLM,
231
+ AutoTokenizer,
232
+ GenerationConfig,
233
+ )
234
+
235
+ MODEL_ID = "RomilY/PCaPLMM_SFT"
236
+
237
+ tokenizer = AutoTokenizer.from_pretrained(
238
+ MODEL_ID,
239
+ use_fast=False,
240
+ trust_remote_code=True,
241
+ )
242
+
243
+ model_kwargs = {
244
+ "trust_remote_code": True,
245
+ "torch_dtype": torch.bfloat16 if torch.cuda.is_available() else torch.float32,
246
+ }
247
+
248
+ if torch.cuda.is_available():
249
+ model_kwargs["device_map"] = "auto"
250
+
251
+ model = AutoModelForCausalLM.from_pretrained(
252
+ MODEL_ID,
253
+ **model_kwargs,
254
+ )
255
+ model.generation_config = GenerationConfig.from_pretrained(MODEL_ID)
256
+ model.eval()
257
+
258
+ messages = [
259
+ {
260
+ "role": "user",
261
+ "content": (
262
+ "ๅ‰ๅˆ—่…บ็™Œๆ‚ฃ่€…ๅœจๅผ€ๅง‹ๆ–ฐ็š„่ฟๅŠจ่ฎกๅˆ’ๅ‰๏ผŒ้œ€่ฆ่€ƒ่™‘ๅ“ชไบ›ๅ› ็ด ๏ผŸ"
263
+ "่ฏทๅŒบๅˆ†ไธ€่ˆฌๅฅๅบทๆ•™่‚ฒไธŽๅฟ…้กปๅ’จ่ฏขไธดๅบŠๅŒป็”Ÿ็š„ๆƒ…ๅ†ตใ€‚"
264
+ ),
265
+ }
266
+ ]
267
+
268
+ with torch.inference_mode():
269
+ response = model.chat(tokenizer, messages)
270
+
271
+ print(response)
272
  ```
273
 
274
+ ### Multi-turn inference
275
 
276
  ```python
277
+ messages = [
278
+ {
279
+ "role": "user",
280
+ "content": "ๅ‰ๅˆ—่…บ็™Œๆฒป็–—ๆœŸ้—ด๏ผŒๆ€Žๆ ทๅˆถๅฎš่พƒๅฎ‰ๅ…จ็š„ๆ—ฅๅธธๆดปๅŠจ่ฎกๅˆ’๏ผŸ",
281
+ }
282
+ ]
283
+
284
+ with torch.inference_mode():
285
+ first_response = model.chat(tokenizer, messages)
286
+
287
+ messages.append({"role": "assistant", "content": first_response})
288
+ messages.append(
289
+ {
290
+ "role": "user",
291
+ "content": "ๅฆ‚ๆžœๆ‚ฃ่€…ๅŒๆ—ถๅญ˜ๅœจ้ชจ่ฝฌ็งป้ฃŽ้™ฉ๏ผŒๅ“ชไบ›ๅปบ่ฎฎไธ่ƒฝ็›ดๆŽฅ็…งๆฌ๏ผŸ",
292
+ }
293
+ )
294
+
295
+ with torch.inference_mode():
296
+ second_response = model.chat(tokenizer, messages)
297
+
298
+ print(second_response)
299
+ ```
300
+
301
+ ### Download with Git
302
+
303
+ The repository contains approximately 15 GB of model files.
304
 
305
+ ```bash
306
+ git lfs install
307
+ git clone https://huggingface.co/RomilY/PCaPLMM_SFT
308
+ ```
309
 
310
+ ### Generation configuration
311
+
312
+ The repository's default `generation_config.json` specifies:
313
+
314
+ | Parameter | Default |
315
+ |---|---:|
316
+ | `do_sample` | `true` |
317
+ | `temperature` | `0.3` |
318
+ | `top_p` | `0.85` |
319
+ | `top_k` | `5` |
320
+ | `repetition_penalty` | `1.05` |
321
+ | `max_new_tokens` | `2048` |
322
+
323
+ 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.
324
+
325
+ ### Hardware considerations
326
+
327
+ 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.
328
+
329
+ ## Repository contents
330
+
331
+ The current release includes the following principal files:
332
+
333
+ ```text
334
+ PCaPLMM_SFT/
335
+ โ”œโ”€โ”€ README.md
336
+ โ”œโ”€โ”€ config.json
337
+ โ”œโ”€โ”€ configuration.json
338
+ โ”œโ”€โ”€ configuration_baichuan.py
339
+ โ”œโ”€โ”€ generation_config.json
340
+ โ”œโ”€โ”€ generation_utils.py
341
+ โ”œโ”€โ”€ model-00001-of-00004.safetensors
342
+ โ”œโ”€โ”€ model-00002-of-00004.safetensors
343
+ โ”œโ”€โ”€ model-00003-of-00004.safetensors
344
+ โ”œโ”€โ”€ model-00004-of-00004.safetensors
345
+ โ”œโ”€โ”€ model.safetensors.index.json
346
+ โ”œโ”€โ”€ modeling_baichuan.py
347
+ โ”œโ”€โ”€ Modelfile
348
+ โ”œโ”€โ”€ quantizer.py
349
+ โ”œโ”€โ”€ special_tokens_map.json
350
+ โ”œโ”€โ”€ tokenization_baichuan.py
351
+ โ”œโ”€โ”€ tokenizer.model
352
+ โ””โ”€โ”€ tokenizer_config.json
353
  ```
354
 
355
+ ## Responsible-use recommendations
356
 
357
+ Research deployments should, at minimum:
 
358
 
359
+ 1. use retrieval from current and curated evidence rather than relying only on parametric memory;
360
+ 2. retain source metadata and display evidence provenance;
361
+ 3. require human review before any content reaches patients;
362
+ 4. implement checks for unsupported claims, medication advice, contraindications, and emergency symptoms;
363
+ 5. preserve prompts, retrieved passages, model versions, generation settings, and reviewer decisions for audit;
364
+ 6. conduct subgroup and language-specific evaluation;
365
+ 7. prohibit the entry of identifiable patient information unless an approved privacy and security framework is in place; and
366
+ 8. define a process for updating or withdrawing the model when evidence or safety requirements change.
367
 
368
+ ## License
 
369
 
370
+ 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.
371
+
372
+ Before use or redistribution, review:
373
+
374
+ - [Baichuan2-7B-Chat model card and terms](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat)
375
+ - [Baichuan 2 Model Community License](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/resolve/main/Baichuan%202%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf)
376
+ - [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
377
+
378
+ Nothing in this model card grants rights beyond those provided by the applicable licenses.
379
+
380
+ ## Citation
381
+
382
+ The associated manuscript citation should replace the provisional repository citation below once the article is publicly available.
383
+
384
+ ```bibtex
385
+ @misc{pcaplmm_sft_2026,
386
+ title = {PCaPLMM-SFT: A Bilingual Domain-Specific Language Model for Prostate Cancer Lifestyle Management},
387
+ author = {{PCaPLMM-SFT Development Team}},
388
+ year = {2026},
389
+ publisher = {Hugging Face},
390
+ howpublished = {\url{https://huggingface.co/RomilY/PCaPLMM_SFT}},
391
+ note = {Research model; accessed YYYY-MM-DD}
392
+ }
393
+ ```
394
+
395
+ ## Acknowledgements
396
+
397
+ This work builds on:
398
 
 
399
  - [Baichuan2-7B-Chat](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat)
400
+ - [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)
401
+ - [BGE-M3](https://huggingface.co/BAAI/bge-m3)
402
+ - [FAISS](https://github.com/facebookresearch/faiss)
403
 
404
+ ## Contact
405
 
406
+ Repository maintainer: **Fangyuan Jiang**
407
+ Email: [theromily@gmail.com](mailto:theromily@gmail.com)
 
 
408
 
409
+ For reproducibility questions, suspected safety issues, or documentation corrections, open a discussion in the Hugging Face repository or contact the maintainer.
410
 
411
+ ## Change log
412
 
413
+ ### Model-card revision โ€” 11 July 2026
 
 
414
 
415
+ - aligned the single-turn instruction-data count with the final study dataset;
416
+ - standardized the training-data name as `PCaPLMM-SFT instruction dataset`;
417
+ - replaced placeholder repository identifiers with `RomilY/PCaPLMM_SFT`;
418
+ - updated inference examples to use the model's custom Baichuan code and chat interface;
419
+ - corrected the repository description from a standalone LoRA adapter to merged full-model weights;
420
+ - aligned the file tree with the files currently present in the repository;
421
+ - clarified that clinical guideline text was not used as training text;
422
+ - added intended-use, out-of-scope-use, evaluation, limitation, bias, safety, licensing, and reproducibility sections; and
423
+ - added Hugging Face metadata for task, library, languages, base model, license, and discoverability.