Instructions to use onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM") model = AutoModelForCausalLM.from_pretrained("onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM
- SGLang
How to use onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM 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 "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM" \ --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": "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM", "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 "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM" \ --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": "onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM with Docker Model Runner:
docker model run hf.co/onnx-internal-testing/tiny-random-ModernBertDecoderForCausalLM
Match "layer_types" length with "num_hidden_layers"
#1
by tomaarsen HF Staff - opened
- config.json +1 -6
config.json
CHANGED
|
@@ -29,12 +29,7 @@
|
|
| 29 |
"layer_norm_eps": 1e-05,
|
| 30 |
"layer_types": [
|
| 31 |
"full_attention",
|
| 32 |
-
"sliding_attention"
|
| 33 |
-
"sliding_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"sliding_attention",
|
| 36 |
-
"sliding_attention",
|
| 37 |
-
"full_attention"
|
| 38 |
],
|
| 39 |
"local_rope_theta": 160000.0,
|
| 40 |
"masked_prediction": false,
|
|
|
|
| 29 |
"layer_norm_eps": 1e-05,
|
| 30 |
"layer_types": [
|
| 31 |
"full_attention",
|
| 32 |
+
"sliding_attention"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
],
|
| 34 |
"local_rope_theta": 160000.0,
|
| 35 |
"masked_prediction": false,
|