Text Generation
Transformers
Safetensors
English
mistral
ai-safety
safetyguard
safety
benchmark
salad-bench
evaluation
judge
text-generation-inference
Instructions to use OpenSafetyLab/MD-Judge-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenSafetyLab/MD-Judge-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenSafetyLab/MD-Judge-v0.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenSafetyLab/MD-Judge-v0.1") model = AutoModelForCausalLM.from_pretrained("OpenSafetyLab/MD-Judge-v0.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenSafetyLab/MD-Judge-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenSafetyLab/MD-Judge-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenSafetyLab/MD-Judge-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenSafetyLab/MD-Judge-v0.1
- SGLang
How to use OpenSafetyLab/MD-Judge-v0.1 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 "OpenSafetyLab/MD-Judge-v0.1" \ --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": "OpenSafetyLab/MD-Judge-v0.1", "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 "OpenSafetyLab/MD-Judge-v0.1" \ --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": "OpenSafetyLab/MD-Judge-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenSafetyLab/MD-Judge-v0.1 with Docker Model Runner:
docker model run hf.co/OpenSafetyLab/MD-Judge-v0.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -17,6 +17,8 @@ tags:
|
|
| 17 |
- mistral
|
| 18 |
- salad-bench
|
| 19 |
- evluation
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
# MD-Judge for Salad-Bench
|
| 22 |
|
|
@@ -25,16 +27,16 @@ tags:
|
|
| 25 |
|
| 26 |
MD-Judge is a LLM-based safetyguard, fine-tund on top of [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1). MD-Judge serves as a classifier to evaluate the safety of QA pairs.
|
| 27 |
|
| 28 |
-
MD-Judge was born to study the safety of different LLMs serving as an general evaluation tool, which is proposed under the
|
| 29 |
-
|
| 30 |
-
- **
|
| 31 |
-
- **
|
|
|
|
| 32 |
|
| 33 |
## Model Sources
|
| 34 |
|
| 35 |
-
- **Repository:** [SALAD-Bench Github](
|
| 36 |
-
- **Paper:** [SALAD-BENCH](
|
| 37 |
-
|
| 38 |
## Model Performance
|
| 39 |
|
| 40 |
Compare our MD-Judge model with other methods on different public safety testsets using QA format. All the model-based methods are evaluated using the same safety proxy template.
|
|
@@ -122,5 +124,4 @@ Please refer to our [Github](https://github.com/OpenSafetyLab/SALAD-BENCH) for m
|
|
| 122 |
archivePrefix={arXiv},
|
| 123 |
primaryClass={cs.CL}
|
| 124 |
}
|
| 125 |
-
```
|
| 126 |
-
|
|
|
|
| 17 |
- mistral
|
| 18 |
- salad-bench
|
| 19 |
- evluation
|
| 20 |
+
- judge
|
| 21 |
+
pipeline_tag: text-generation
|
| 22 |
---
|
| 23 |
# MD-Judge for Salad-Bench
|
| 24 |
|
|
|
|
| 27 |
|
| 28 |
MD-Judge is a LLM-based safetyguard, fine-tund on top of [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1). MD-Judge serves as a classifier to evaluate the safety of QA pairs.
|
| 29 |
|
| 30 |
+
MD-Judge was born to study the safety of different LLMs serving as an general evaluation tool, which is proposed under the 🥗SALAD-Bench. You can check the following source for more information:
|
| 31 |
+
- [**Paper**](https://arxiv.org/abs/2402.02416)
|
| 32 |
+
- [**Code**](https://github.com/OpenSafetyLab/SALAD-BENCH)
|
| 33 |
+
- [**Data**](https://huggingface.co/datasets/OpenSafetyLab/Salad-Data)
|
| 34 |
+
- [**Project Page**](https://adwardlee.github.io/salad_bench/)
|
| 35 |
|
| 36 |
## Model Sources
|
| 37 |
|
| 38 |
+
- **Repository:** [SALAD-Bench Github]()
|
| 39 |
+
- **Paper:** [SALAD-BENCH]()
|
|
|
|
| 40 |
## Model Performance
|
| 41 |
|
| 42 |
Compare our MD-Judge model with other methods on different public safety testsets using QA format. All the model-based methods are evaluated using the same safety proxy template.
|
|
|
|
| 124 |
archivePrefix={arXiv},
|
| 125 |
primaryClass={cs.CL}
|
| 126 |
}
|
| 127 |
+
```
|
|
|