High-performance ONNX Runtime bindings for PHP using CPU execution.
⚠️ This is a read-only split repository.For full documentation, contributing guidelines, bug reports, and feature requests, please visit the main repository: https://github.com/phpmlkit/onnxruntime
composer require phpmlkit/onnxruntimeuse PhpMlKit\ONNXRuntime\InferenceSession;
use PhpMlKit\ONNXRuntime\OrtValue;
use PhpMlKit\ONNXRuntime\Enums\DataType;
$session = InferenceSession::fromFile('model.onnx');
$input = OrtValue::fromArray([1.0, 2.0, 3.0], DataType::FLOAT);
$outputs = $session->run(['input' => $input]);
$result = $outputs['output']->toArray();- Full Documentation: https://github.com/phpmlkit/onnxruntime/blob/main/README.md
- API Reference: See inline PHPDoc in the source code
- Examples: https://github.com/phpmlkit/onnxruntime/tree/main/examples
Need GPU acceleration? Use the GPU package instead:
composer require phpmlkit/onnxruntime-gpuContributions are welcome! Please submit pull requests to the main repository: https://github.com/phpmlkit/onnxruntime
- Issues: https://github.com/phpmlkit/onnxruntime/issues
- Discussions: https://github.com/phpmlkit/onnxruntime/discussions
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This package is automatically generated from the monorepo. Do not submit pull requests to this repository.