Exception: Kotoshu::Models::OnnxModel::OnnxUnavailable

Inherits:
Error
  • Object
show all
Defined in:
lib/kotoshu/models/onnx_model.rb

Overview

Error raised when semantic features are requested but onnxruntime is unavailable. Caller-friendly message points at the fix.

Instance Method Summary collapse

Constructor Details

#initialize(detail = nil) ⇒ OnnxUnavailable

Returns a new instance of OnnxUnavailable.



39
40
41
42
43
44
45
# File 'lib/kotoshu/models/onnx_model.rb', line 39

def initialize(detail = nil)
  message = "onnxruntime gem not loaded"
  message += " (#{detail})" if detail
  message += ". Install with: gem install onnxruntime"
  message += ". Or set KOTOSHU_NO_ONNX=1 to silence this in code paths that opt out."
  super(message)
end