Skip to content

Commit aabde77

Browse files
committed
fix: Make ONNX runtime optional with build tag
1 parent ef5c2db commit aabde77

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

mlx_onnx.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// +build cgo
1+
//go:build cgo && onnx
2+
// +build cgo,onnx
23

34
package mlx
45

mlx_onnx_stub.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//go:build !onnx
2+
// +build !onnx
3+
4+
package mlx
5+
6+
// Stub functions when ONNX is not available
7+
8+
func detectONNXBackend() bool {
9+
return false
10+
}
11+
12+
func getONNXVersion() string {
13+
return "not available"
14+
}
15+
16+
func hasONNXSupport() bool {
17+
return false
18+
}

0 commit comments

Comments
 (0)