Instructions to use kazssym/stablelm-3b-4e1t-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kazssym/stablelm-3b-4e1t-onnx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kazssym/stablelm-3b-4e1t-onnx")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kazssym/stablelm-3b-4e1t-onnx") model = AutoModelForCausalLM.from_pretrained("kazssym/stablelm-3b-4e1t-onnx") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use kazssym/stablelm-3b-4e1t-onnx with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kazssym/stablelm-3b-4e1t-onnx" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kazssym/stablelm-3b-4e1t-onnx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kazssym/stablelm-3b-4e1t-onnx
- SGLang
How to use kazssym/stablelm-3b-4e1t-onnx 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 "kazssym/stablelm-3b-4e1t-onnx" \ --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": "kazssym/stablelm-3b-4e1t-onnx", "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 "kazssym/stablelm-3b-4e1t-onnx" \ --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": "kazssym/stablelm-3b-4e1t-onnx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kazssym/stablelm-3b-4e1t-onnx with Docker Model Runner:
docker model run hf.co/kazssym/stablelm-3b-4e1t-onnx
Description
This is an ONNX model for our test scripts. It was exported from stabilityai/stablelm-3b-4e1t to ONNX with a modified version of Hugging Face Optimum. It is quite possible to have problems.
Exporting
This model was exported with our test scripts.
The source model requires Transformers 4.38 or later to export.
- Downloads last month
- 8