Class: GTE::Model
- Inherits:
-
Object
- Object
- GTE::Model
- Defined in:
- lib/gte/model.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #[](input) ⇒ Object
- #embed(texts) ⇒ Object
-
#initialize(config) ⇒ Model
constructor
A new instance of Model.
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/gte/model.rb', line 5 def config @config end |
Instance Method Details
#[](input) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/gte/model.rb', line 20 def [](input) case input when String then (input).row(0) when Array then (input) end end |
#embed(texts) ⇒ Object
14 15 16 17 18 |
# File 'lib/gte/model.rb', line 14 def (texts) return @embedder.(texts) if texts.is_a?(String) @embedder.(Array(texts)) end |