diff --git a/shard.yml b/shard.yml index d9a5c8c..6265e6b 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: tensorflow_lite -version: 1.6.3 +version: 1.6.4 development_dependencies: ameba: diff --git a/src/tensorflow_lite/client.cr b/src/tensorflow_lite/client.cr index 43359f8..2e9ae64 100644 --- a/src/tensorflow_lite/client.cr +++ b/src/tensorflow_lite/client.cr @@ -8,6 +8,11 @@ class TensorflowLite::Client include Indexable(Tensor) # Configures the tensorflow interpreter with the options provided + def self.new(model : URI | Bytes | Path | Model | String, delegate : Delegate? = nil, threads : Int? = nil, labels : URI | Hash(Int32, String)? = nil) + Client.new(model, delegate, threads, labels) { |error_message| Log.error { error_message } } + end + + # :ditto: def initialize(model : URI | Bytes | Path | Model | String, delegate : Delegate? = nil, threads : Int? = nil, labels : URI | Hash(Int32, String)? = nil, &on_error : String -> Nil) @labels_fetched = !!@labels @model = case model @@ -55,11 +60,6 @@ class TensorflowLite::Client @interpreter = Interpreter.new(@model, @options) end - # :ditto: - def self.new(model : Bytes | Path | Model | String, delegate : Delegate? = nil, threads : Int? = nil) - Client.new(model, delegate, threads) { |error_message| Log.warn { error_message } } - end - getter model : Model getter model_path : Path? = nil getter options : InterpreterOptions