MedQA-ChatGLM  by WangRongsheng

Fine-tuning script for medical QA ChatGLM models

created 2 years ago
327 stars

Top 84.6% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides fine-tuned versions of the ChatGLM model for medical question answering, targeting researchers and developers in the medical AI domain. It offers several fine-tuning methods (LoRA, P-Tuning V2, Freeze) on medical dialogue datasets, enabling improved performance on medical Q&A tasks.

How It Works

The project fine-tunes the ChatGLM-6B base model using various parameter-efficient fine-tuning techniques like LoRA, P-Tuning V2, and Freeze. It leverages the cMedQA2 dataset, which includes real medical dialogues, to adapt the model for medical contexts. This approach allows for significant performance gains with reduced computational resources compared to full model fine-tuning.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Fine-tuning command example (LoRA): CUDA_VISIBLE_DEVICES=0 python MedQA-ChatGLM/finetune.py --do_train --dataset merged-cMedQA --finetuning_type lora --output_dir ./med-lora ...
  • Requires Python and a GPU (A100 80GB mentioned for training).
  • Inference can be done via web demo (web_demo.py) or command line (infer.py).
  • Official documentation for parameters is available at docs/参数详解.md.

Highlighted Details

  • Fine-tuned models available for LoRA, P-Tuning V2, and Freeze methods.
  • Training conducted on Linux with A100 (1x, 80GB) hardware.
  • Supports merging fine-tuned weights for easier deployment.
  • Demonstrates fine-tuning on datasets like cMedQA2, Huatuo-data, and MedDialog.

Maintenance & Community

The project references several related GitHub repositories, indicating community engagement and shared development in the medical LLM space. No specific community channels (Discord/Slack) or active maintainer information is provided in the README.

Licensing & Compatibility

The project explicitly states: "本项目相关资源仅供学术研究之用,严禁用于商业用途." (These resources are for academic research only and strictly prohibited for commercial use.) It also notes adherence to third-party code licenses.

Limitations & Caveats

The project is strictly for academic research and prohibits commercial use. The generated medical content is not guaranteed for accuracy and should not be used for actual medical diagnosis. The dataset is largely model-generated.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
7 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.