Instructions to use ReasoningShield/ReasoningShield-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ReasoningShield/ReasoningShield-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ReasoningShield/ReasoningShield-1B")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ReasoningShield/ReasoningShield-1B", dtype="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ReasoningShield/ReasoningShield-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ReasoningShield/ReasoningShield-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ReasoningShield/ReasoningShield-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ReasoningShield/ReasoningShield-1B
- SGLang
How to use ReasoningShield/ReasoningShield-1B 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 "ReasoningShield/ReasoningShield-1B" \ --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": "ReasoningShield/ReasoningShield-1B", "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 "ReasoningShield/ReasoningShield-1B" \ --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": "ReasoningShield/ReasoningShield-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ReasoningShield/ReasoningShield-1B with Docker Model Runner:
docker model run hf.co/ReasoningShield/ReasoningShield-1B
Update README.md
Browse files
README.md
CHANGED
|
@@ -32,11 +32,6 @@ datasets:
|
|
| 32 |
<a href="https://github.com/CosmosYi/ReasoningShield" target="_blank" style="margin: 2px;">
|
| 33 |
<img alt="GitHub Page" src="https://img.shields.io/badge/GitHub-Page-black?logo=github " style="display: inline-block; vertical-align: middle;">
|
| 34 |
</a>
|
| 35 |
-
|
| 36 |
-
<!-- Paper -->
|
| 37 |
-
<a href=" " target="_blank" style="margin: 2px;">
|
| 38 |
-
<img alt="Paper" src="https://img.shields.io/badge/%E2%9C%8D%EF%B8%8F%20Paper-arXiv%202508.0001-f5de53?color=f5de53&logoColor=white " style="display: inline-block; vertical-align: middle;"/>
|
| 39 |
-
</a>
|
| 40 |
|
| 41 |
<!-- Huggingface Model -->
|
| 42 |
<a href="https://huggingface.co/ReasoningShield/ReasoningShield-1B" target="_blank" style="margin: 2px;">
|
|
@@ -92,8 +87,7 @@ datasets:
|
|
| 92 |
|
| 93 |
- The model is trained on a high-quality dataset of 7,000 QT pairs, please refer to the following link for detailed information:
|
| 94 |
|
| 95 |
-
- https://huggingface.co/datasets/ReasoningShield/ReasoningShield-Dataset
|
| 96 |
-
-
|
| 97 |
|
| 98 |
- **Risk Categories** :
|
| 99 |
|
|
|
|
| 32 |
<a href="https://github.com/CosmosYi/ReasoningShield" target="_blank" style="margin: 2px;">
|
| 33 |
<img alt="GitHub Page" src="https://img.shields.io/badge/GitHub-Page-black?logo=github " style="display: inline-block; vertical-align: middle;">
|
| 34 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
<!-- Huggingface Model -->
|
| 37 |
<a href="https://huggingface.co/ReasoningShield/ReasoningShield-1B" target="_blank" style="margin: 2px;">
|
|
|
|
| 87 |
|
| 88 |
- The model is trained on a high-quality dataset of 7,000 QT pairs, please refer to the following link for detailed information:
|
| 89 |
|
| 90 |
+
- ***ReasoningShield-Dataset:*** https://huggingface.co/datasets/ReasoningShield/ReasoningShield-Dataset
|
|
|
|
| 91 |
|
| 92 |
- **Risk Categories** :
|
| 93 |
|