Text Generation
PEFT
Safetensors
Transformers
English
lora
qlora
medical
research-artifact
conversational
Instructions to use Babblu2821/tinyllama-medqa-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Babblu2821/tinyllama-medqa-qlora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = PeftModel.from_pretrained(base_model, "Babblu2821/tinyllama-medqa-qlora") - Transformers
How to use Babblu2821/tinyllama-medqa-qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Babblu2821/tinyllama-medqa-qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Babblu2821/tinyllama-medqa-qlora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Babblu2821/tinyllama-medqa-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Babblu2821/tinyllama-medqa-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/tinyllama-medqa-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Babblu2821/tinyllama-medqa-qlora
- SGLang
How to use Babblu2821/tinyllama-medqa-qlora 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/tinyllama-medqa-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/tinyllama-medqa-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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/tinyllama-medqa-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Babblu2821/tinyllama-medqa-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Babblu2821/tinyllama-medqa-qlora with Docker Model Runner:
docker model run hf.co/Babblu2821/tinyllama-medqa-qlora
docs: replace LLM-judge factual ratings with the human pass
Browse files
README.md
CHANGED
|
@@ -32,7 +32,7 @@ Code, method and full results: **https://github.com/fayazhussain2821/llm-finetun
|
|
| 32 |
> This is a **methodology demonstration**, not a medical tool. Its factual reliability
|
| 33 |
> has been measured, and while it is the best arm in this project, it is still poor: on
|
| 34 |
> a blinded review of 20 held-out questions it **contradicted the reference answer or
|
| 35 |
-
> invented an entity in
|
| 36 |
>
|
| 37 |
> It produces fluent, confident, well-formed text that is frequently wrong. Fluency is
|
| 38 |
> exactly what makes this dangerous.
|
|
@@ -113,16 +113,19 @@ No degeneration — the model does not loop.
|
|
| 113 |
|
| 114 |
| | mean ↑ | contradicts reference ↓ |
|
| 115 |
|---|---|---|
|
| 116 |
-
| base (control) | 2.
|
| 117 |
-
| **this model** | **
|
| 118 |
|
| 119 |
Fine-tuning produced **no detectable improvement in factual accuracy** (paired 95% CI
|
| 120 |
-
−0.
|
| 121 |
What *is* detectable is that the untouched base model already beats the fully
|
| 122 |
-
fine-tuned GPT-2 arm by +1.10 (95% CI +0.
|
| 123 |
|
| 124 |
-
These ratings
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
## Usage
|
| 128 |
|
|
|
|
| 32 |
> This is a **methodology demonstration**, not a medical tool. Its factual reliability
|
| 33 |
> has been measured, and while it is the best arm in this project, it is still poor: on
|
| 34 |
> a blinded review of 20 held-out questions it **contradicted the reference answer or
|
| 35 |
+
> invented an entity in 35% of them**, scoring **3.25 out of 5** for factual soundness.
|
| 36 |
>
|
| 37 |
> It produces fluent, confident, well-formed text that is frequently wrong. Fluency is
|
| 38 |
> exactly what makes this dangerous.
|
|
|
|
| 113 |
|
| 114 |
| | mean ↑ | contradicts reference ↓ |
|
| 115 |
|---|---|---|
|
| 116 |
+
| base (control) | 2.90 | 50% |
|
| 117 |
+
| **this model** | **3.25** | **35%** |
|
| 118 |
|
| 119 |
Fine-tuning produced **no detectable improvement in factual accuracy** (paired 95% CI
|
| 120 |
+
−0.20 to +0.90, spanning zero), despite the automatic metrics reporting large gains.
|
| 121 |
What *is* detectable is that the untouched base model already beats the fully
|
| 122 |
+
fine-tuned GPT-2 arm by +1.10 (95% CI +0.35 to +1.85).
|
| 123 |
|
| 124 |
+
These ratings are a human pass, rated blind to which model produced each answer, by
|
| 125 |
+
the repository's author — one non-expert rater, not a clinician and not adjudicated by
|
| 126 |
+
a second. An earlier LLM-judge pass over the same sheet scored every arm lower (2.70
|
| 127 |
+
mean, 40% contradiction for this model) but reached every identical verdict; both are
|
| 128 |
+
published in the source repository.
|
| 129 |
|
| 130 |
## Usage
|
| 131 |
|