Instructions to use fxmarty/tiny-gemma-onnx-quantized-trt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fxmarty/tiny-gemma-onnx-quantized-trt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fxmarty/tiny-gemma-onnx-quantized-trt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fxmarty/tiny-gemma-onnx-quantized-trt") model = AutoModelForCausalLM.from_pretrained("fxmarty/tiny-gemma-onnx-quantized-trt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fxmarty/tiny-gemma-onnx-quantized-trt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fxmarty/tiny-gemma-onnx-quantized-trt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fxmarty/tiny-gemma-onnx-quantized-trt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fxmarty/tiny-gemma-onnx-quantized-trt
- SGLang
How to use fxmarty/tiny-gemma-onnx-quantized-trt 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 "fxmarty/tiny-gemma-onnx-quantized-trt" \ --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": "fxmarty/tiny-gemma-onnx-quantized-trt", "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 "fxmarty/tiny-gemma-onnx-quantized-trt" \ --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": "fxmarty/tiny-gemma-onnx-quantized-trt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fxmarty/tiny-gemma-onnx-quantized-trt with Docker Model Runner:
docker model run hf.co/fxmarty/tiny-gemma-onnx-quantized-trt
Download ort_config.json from fxmarty/tiny-gemma-onnx-quantized-trt: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/fxmarty/tiny-gemma-onnx-quantized-trt/resolve/main/ort_config.json
- Command line
-
hf download hf://fxmarty/tiny-gemma-onnx-quantized-trt/ort_config.json
-
curl -L -o ort_config.json https://huggingface.co/fxmarty/tiny-gemma-onnx-quantized-trt/resolve/main/ort_config.json
1.02 kB
| { | |
| "one_external_file": true, | |
| "opset": null, | |
| "optimization": {}, | |
| "optimum_version": "1.18.0.dev0", | |
| "quantization": { | |
| "activations_dtype": "QInt8", | |
| "activations_symmetric": true, | |
| "format": "QDQ", | |
| "is_static": true, | |
| "mode": "QLinearOps", | |
| "nodes_to_exclude": [], | |
| "nodes_to_quantize": [], | |
| "operators_to_quantize": [ | |
| "Conv", | |
| "ConvTranspose", | |
| "Gemm", | |
| "Clip", | |
| "Relu", | |
| "Reshape", | |
| "Transpose", | |
| "Squeeze", | |
| "Unsqueeze", | |
| "Resize", | |
| "MaxPool", | |
| "AveragePool", | |
| "MatMul", | |
| "Split", | |
| "Gather", | |
| "Where", | |
| "InstanceNormalization", | |
| "LayerNormalization" | |
| ], | |
| "per_channel": false, | |
| "qdq_add_pair_to_weight": true, | |
| "qdq_dedicated_pair": true, | |
| "qdq_op_type_per_channel_support_to_axis": { | |
| "MatMul": 1 | |
| }, | |
| "reduce_range": false, | |
| "weights_dtype": "QInt8", | |
| "weights_symmetric": true | |
| }, | |
| "transformers_version": "4.39.0.dev0", | |
| "use_external_data_format": true | |
| } | |