Downloads · 30 days
6
16% of all-time downloads
debashis2007/healthcare-gpt2
healthcare-gpt2 is a text generation model from debashis2007. Use it when you need the model to write or continue text. It is set up for peft.
A fine-tuned GPT-2 model specialized for healthcare and medical text generation using LoRA (Low-Rank Adaptation).
Downloads · 30 days
6
16% of all-time downloads
All-time downloads
37
Public
Repo size
4.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors4.7 MB · 50%
From the Hugging Face model README
A fine-tuned GPT-2 model specialized for healthcare and medical text generation using LoRA (Low-Rank Adaptation).
This model is a fine-tuned version of GPT-2, optimized for healthcare-related text generation. It has been trained on healthcare datasets including clinical notes, medical Q&A, medication information, and other medical text data.
The model uses LoRA (Low-Rank Adaptation) for efficient fine-tuning, allowing it to be trained with minimal computational resources while maintaining the base model's general language capabilities.
This model is intended for:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("gpt2")
tokenizer = AutoTokenizer.from_pretrained("gpt2")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "./cpu_healthcare_output")
# Generate text
prompt = "Patient presents with:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The model was fine-tuned on healthcare datasets including:
If you use this model, please cite:
@misc{healthcare-gpt2-lora,
title={Healthcare GPT-2 LoRA Model},
author={Fine-tuned for healthcare applications},
year={2024},
base_model={gpt2}
}