Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Domain-Specific Assistant: Medical AI

This project implements a Medical AI Assistant by fine-tuning the TinyLlama-1.1B model on the Medical Flashcards dataset using LoRA (Low-Rank Adaptation).

Project Structure

  • Medical_Assistant_Fine_Tuning.ipynb: Jupyter Notebook for data preprocessing, model fine-tuning, and evaluation. tailored for Google Colab (Free Tier).
  • app.py: Gradio web application for interacting with the fine-tuned model.
  • requirements.txt: List of Python dependencies.

Setup Instructions

1. Fine-Tuning (Google Colab)

  1. Upload Medical_Assistant_Fine_Tuning.ipynb to Google Colab.
  2. Change the runtime type to T4 GPU.
  3. Run all cells to fine-tune the model.
  4. The fine-tuned adapter will be saved. You can download the medical_assistant_adapter folder.

2. Running the Web App (Local)

  1. Install dependencies:
    pip3 install -r requirements.txt
  2. Ensure you have the medical_assistant_adapter folder in the same directory (or update the path in app.py).
  3. Run the app:
    python3 app.py
  4. Open the provided local URL in your browser.

Note: If you are running on macOS or a machine without NVIDIA GPU, the app will automatically load the model in full precision (which requires ~4GB RAM) instead of 4-bit mode.

Methodology

  • Model: TinyLlama-1.1B-Chat-v1.0 (Quantized to 4-bit)
  • Dataset: medalpaca/medical_meadow_medical_flashcards
  • Technique: Parameter-Efficient Fine-Tuning (PEFT) using LoRA.
  • Metrics: BLEU and ROUGE scores for evaluation.

Performance

The fine-tuned model demonstrates improved ability to answer medical queries compared to the base model, specifically in maintaining the Q&A format and domain relevance.

Medical_Assistant_Fine_Tuning

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages