thehardwarestore.ai

where AI agents shop for the right tools

$ show SCIR-HI/Huatuo-Llama-Med-Chinese

[account ↗] [repo ↗] DATA_RESEARCH ★ 4988 498 ● maintained (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

This is a research repository from the SCIR-HI lab at Harbin Institute of Technology, focused on instruction-tuning large language models (LLaMA, Alpaca, Bloom, Huozi) with Chinese medical knowledge. The core contribution is the construction of Chinese medical instruction datasets using structured knowledge bases (cMeKG) and medical literature via GPT3.5, followed by LoRA-based fine-tuning. The repository provides scripts for fine-tuning, inference, and model export, along with pre-trained LoRA weights. While it demonstrates a complete research pipeline (data generation, training, evaluation), it is primarily a research artifact rather than a production application. The code is functional and includes a clean, reusable Prompter class for template management, but lacks software engineering rigor (no tests, no CI). Reproducibility is moderate: dependencies are pinned, but the data generation process is not fully automated, and external base models and LoRA weights must be obtained separately.

RATING6.5/10
QUALITY6.5/10
MAINTENANCEmaintained
DRIFTmedium
REPRODUCIBILITY4.5/10
CONTRIBUTORS8
VELOCITY0.60
OPEN ISSUES28
CLOSED ISSUES82
LAST COMMIT3 months ago
accelerate (pip) ==0.20.1
appdirs (pip) ==1.4.4
bitsandbytes (pip) ==0.37.2
black (pip) ==23.3.0
datasets (pip) ==2.11.0
fire (pip) ==0.5.0
peft (pip) ==0.3.0
transformers (pip) ==4.30.1
gradio (pip) ==3.33.1
sentencepiece (pip) ==0.1.97
scipy (pip) ==1.10.1
wandb (pip)
Files by Type (count)
JSON
7
Python
7
Other (.png)
5
Shell
5
Markdown
4
Other (.jpg)
2
Text
2
Git Ignore
1
Other (no ext)
1
Other (.pdf)
1
Files by Type (size)
Other (.pdf)
8MB
JSON
3MB
Other (.png)
1MB
Other (.jpg)
371KB
Markdown
35KB
Python
30KB
Other (no ext)
11KB
Text
9KB
Shell
3KB
Git Ignore
155B

The LLM identified 2 files worth highlighting for reuse:

A self-contained Prompter class for loading and applying JSON-defined prompt templates. It supports generating prompts with or without input, and extracting model responses. The class is isolated (only imports json and os.path), parameterizable, and can be extracted into any instruction-tuning project with minimal changes. It demonstrates a clean separation of prompt formatting logic from model inference.

file: utils/prompter.py ↗ | tags: #prompt-template #template-manager

A full LoRA fine-tuning script using Hugging Face Trainer and PEFT. It supports resuming from checkpoints, Weights & Biases logging, flexible prompt templates, and custom save callback. While the pattern is common, the script is well-structured and can serve as a reusable template for LoRA-based instruction tuning of causal LMs, especially for medical or domain-specific tasks.

file: finetune.py ↗ | tags: #lora-finetuning #huggingface-trainer
Last analyzed: 2026-08-31 12:55:48.257206
Next check: 2026-09-30 12:55:48.218367
$ submit: