Instructions to use Babblu2821/gpt2-medqa-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Babblu2821/gpt2-medqa-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("gpt2") model = PeftModel.from_pretrained(base_model, "Babblu2821/gpt2-medqa-lora") - Transformers
How to use Babblu2821/gpt2-medqa-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Babblu2821/gpt2-medqa-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Babblu2821/gpt2-medqa-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Babblu2821/gpt2-medqa-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Babblu2821/gpt2-medqa-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/gpt2-medqa-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Babblu2821/gpt2-medqa-lora
- SGLang
How to use Babblu2821/gpt2-medqa-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Babblu2821/gpt2-medqa-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/gpt2-medqa-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Babblu2821/gpt2-medqa-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/gpt2-medqa-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Babblu2821/gpt2-medqa-lora with Docker Model Runner:
docker model run hf.co/Babblu2821/gpt2-medqa-lora
docs: replace LLM-judge factual ratings with the human pass
Browse files
README.md
CHANGED
|
@@ -29,8 +29,8 @@ Code, method and full results: **https://github.com/fayazhussain2821/llm-finetun
|
|
| 29 |
>
|
| 30 |
> This is a **methodology demonstration**, not a medical tool. Its factual reliability
|
| 31 |
> has been measured, and it is poor: on a blinded review of 20 held-out questions, this
|
| 32 |
-
> adapter **contradicted the reference answer or invented an entity in
|
| 33 |
-
> scoring **1.
|
| 34 |
>
|
| 35 |
> It produces fluent, confident, well-formed text that is usually wrong. Observed
|
| 36 |
> failures include attributing Marfan syndrome to "an infection" and inventing
|
|
@@ -101,16 +101,19 @@ No degeneration — the model does not loop. Its problem is that it is wrong.
|
|
| 101 |
|
| 102 |
| | mean ↑ | contradicts reference ↓ |
|
| 103 |
|---|---|---|
|
| 104 |
-
| `gpt2` (control) | 1.
|
| 105 |
-
| **this model** | **1.
|
| 106 |
|
| 107 |
Fine-tuning produced **no detectable improvement in factual accuracy** (paired 95% CI
|
| 108 |
-
−0.
|
| 109 |
gain. LoRA taught this model MedQuAD's *register*, and register is what those metrics
|
| 110 |
score.
|
| 111 |
|
| 112 |
-
These ratings
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
## Usage
|
| 116 |
|
|
|
|
| 29 |
>
|
| 30 |
> This is a **methodology demonstration**, not a medical tool. Its factual reliability
|
| 31 |
> has been measured, and it is poor: on a blinded review of 20 held-out questions, this
|
| 32 |
+
> adapter **contradicted the reference answer or invented an entity in 60% of them**,
|
| 33 |
+
> scoring **1.80 out of 5** for factual soundness.
|
| 34 |
>
|
| 35 |
> It produces fluent, confident, well-formed text that is usually wrong. Observed
|
| 36 |
> failures include attributing Marfan syndrome to "an infection" and inventing
|
|
|
|
| 101 |
|
| 102 |
| | mean ↑ | contradicts reference ↓ |
|
| 103 |
|---|---|---|
|
| 104 |
+
| `gpt2` (control) | 1.60 | 70% |
|
| 105 |
+
| **this model** | **1.80** | **60%** |
|
| 106 |
|
| 107 |
Fine-tuning produced **no detectable improvement in factual accuracy** (paired 95% CI
|
| 108 |
+
−0.40 to +0.80, spanning zero) — while the automatic metrics above reported a 25.8%
|
| 109 |
gain. LoRA taught this model MedQuAD's *register*, and register is what those metrics
|
| 110 |
score.
|
| 111 |
|
| 112 |
+
These ratings are a human pass, rated blind to which model produced each answer, by
|
| 113 |
+
the repository's author — one non-expert rater, not a clinician and not adjudicated by
|
| 114 |
+
a second. An earlier LLM-judge pass over the same sheet rated this adapter far harsher
|
| 115 |
+
(1.20 mean, 95% contradiction) but reached every identical verdict; both are published
|
| 116 |
+
in the source repository.
|
| 117 |
|
| 118 |
## Usage
|
| 119 |
|