Instructions to use UBC-NLP/DetoxLLM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UBC-NLP/DetoxLLM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="UBC-NLP/DetoxLLM-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/DetoxLLM-7B") model = AutoModelForCausalLM.from_pretrained("UBC-NLP/DetoxLLM-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use UBC-NLP/DetoxLLM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "UBC-NLP/DetoxLLM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UBC-NLP/DetoxLLM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/UBC-NLP/DetoxLLM-7B
- SGLang
How to use UBC-NLP/DetoxLLM-7B 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 "UBC-NLP/DetoxLLM-7B" \ --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": "UBC-NLP/DetoxLLM-7B", "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 "UBC-NLP/DetoxLLM-7B" \ --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": "UBC-NLP/DetoxLLM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use UBC-NLP/DetoxLLM-7B with Docker Model Runner:
docker model run hf.co/UBC-NLP/DetoxLLM-7B
Commit History
-
Update README.md
Verified signature2a51c4e
-
Update README.md
Verified signature8435322 -
Update README.md
Verified signatureca15f6e -
Update README.md
Verified signatureca27f95
-
Update README.md
Verified signature70a4933
-
Delete green_llama.png
Verified signature9e09faf -
Update README.md
Verified signatureeea305d -
Upload detoxllm.png
Verified signaturec17fdda
-
Update README.md
Verified signaturef5ffee3
-
Update README.md
Verified signatureac3ee09 -
Update README.md
Verified signature384454e -
Update README.md
Verified signatureed46aad
-
Update README.md
Verified signature667a76d -
Update README.md
Verified signatureffac43f -
Update README.md
Verified signature41400e2 -
Update README.md
Verified signature8b3068b -
Update README.md
Verified signature377ed4b -
Update README.md
Verified signature902e1e3 -
Update README.md
Verified signaturec57d680 -
Update README.md
Verified signature8927374 -
Update README.md
Verified signaturec8f8c88 -
Update README.md
Verified signature2110f1a -
Upload green_llama.png
Verified signature42e95d8 -
Update README.md
Verified signature9bcc381 -
Upload LlamaForCausalLM
Verified signature207f793
-
Upload tokenizer
Verified signature1bbb258 -
initial commit
Verified signature8d0ff27