Class: Eclaircir::Model

Inherits:
BaseModel show all
Defined in:
lib/eclaircir/api_models/model.rb

Instance Method Summary collapse

Methods inherited from BaseModel

#to_api_hash

Instance Method Details

#predict_outputs(url: nil, input: nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/eclaircir/api_models/model.rb', line 14

def predict_outputs(url: nil, input: nil)
  to_predict =  if url
                  Input.from_url(url)
                elsif input
                  input
                end

  if Array(to_predict).empty?
    raise ArgumentError,
      'one of the following keyword arguments should be provided [url, input]'
  end

  Eclaircir.new_client.predict_outputs(self, to_predict)
end