[add] perf fig, vllm example
Browse files- README.md +6 -0
- assets/finetuned_perf.png +0 -0
- assets/qwen2_5-3b-baseline_perf.png +0 -0
- assets/run_vllm.sh +20 -0
README.md
CHANGED
|
@@ -10,6 +10,11 @@ base_model:
|
|
| 10 |
LLM trained to predict a character's emotional response in the given situation
|
| 11 |
* Trained to predict in a structured output format.
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
## Quickstart
|
| 14 |
The model is trained to predict in the following schema
|
| 15 |
```
|
|
@@ -66,6 +71,7 @@ prediction = generator(input_text)
|
|
| 66 |
```
|
| 67 |
|
| 68 |
Using endpoint loaded with vllm & OpenAI client package
|
|
|
|
| 69 |
```
|
| 70 |
client = OpenAI(...)
|
| 71 |
json_schema = EntryResult.model_json_schema()
|
|
|
|
| 10 |
LLM trained to predict a character's emotional response in the given situation
|
| 11 |
* Trained to predict in a structured output format.
|
| 12 |
|
| 13 |
+
Prediction Performance:
|
| 14 |
+
| Baseline (Qwen2.5-3B) | Trained |
|
| 15 |
+
|:----------------------------------:|:------------------------------------:|
|
| 16 |
+
| <img src="./assets/qwen2_5-3b-baseline_perf.png" alt="baseline_perf" width="90%" /> | <img src="./assets/finetuned_perf.png" alt="trained_perf" width="100%" /> |
|
| 17 |
+
|
| 18 |
## Quickstart
|
| 19 |
The model is trained to predict in the following schema
|
| 20 |
```
|
|
|
|
| 71 |
```
|
| 72 |
|
| 73 |
Using endpoint loaded with vllm & OpenAI client package
|
| 74 |
+
* example of using vllm container is provided [here](./assets/run_vllm.sh)
|
| 75 |
```
|
| 76 |
client = OpenAI(...)
|
| 77 |
json_schema = EntryResult.model_json_schema()
|
assets/finetuned_perf.png
ADDED
|
assets/qwen2_5-3b-baseline_perf.png
ADDED
|
assets/run_vllm.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
VLLM_VERSION="v0.8.4"
|
| 3 |
+
|
| 4 |
+
BASE_MODEL_NAME="Qwen/Qwen2.5-3B-Instruct"
|
| 5 |
+
|
| 6 |
+
ADAPTER_NAME="id4thomas/emotion-predictor-Qwen2.5-3B-Instruct"
|
| 7 |
+
ADAPTER_DIR="..." # Path to the directory containing the LoRA adapter
|
| 8 |
+
|
| 9 |
+
docker run --runtime nvidia --gpus all \
|
| 10 |
+
-v ${ADAPTER_DIR}:/vllm-workspace/adapter \
|
| 11 |
+
-v ./cache:/root/.cache/huggingface \
|
| 12 |
+
-p 8010:8000 \
|
| 13 |
+
--ipc=host \
|
| 14 |
+
vllm/vllm-openai:${VLLM_VERSION} \
|
| 15 |
+
--model "Qwen/Qwen2.5-3B-Instruct" \
|
| 16 |
+
--lora-modules '{"name": "${ADAPTER_NAME}", "path": "/vllm-workspace/adapter", "base_model_name": "${BASE_MODEL_NAME}"}' \
|
| 17 |
+
--enable-lora \
|
| 18 |
+
--max-lora-rank 16 \
|
| 19 |
+
--served-model-name ${BASE_MODEL_NAME} \
|
| 20 |
+
--gpu-memory-utilization=0.5
|