Class: Informers::Model
- Inherits:
-
Object
- Object
- Informers::Model
- Defined in:
- lib/informers/model.rb
Overview
TODO remove in 2.0
Instance Method Summary collapse
- #embed(texts) ⇒ Object
-
#initialize(model_id, quantized: false) ⇒ Model
constructor
A new instance of Model.
Constructor Details
#initialize(model_id, quantized: false) ⇒ Model
Returns a new instance of Model.
4 5 6 7 |
# File 'lib/informers/model.rb', line 4 def initialize(model_id, quantized: false) @model = Informers.pipeline("embedding", model_id, quantized: quantized) @options = model_id == "mixedbread-ai/mxbai-embed-large-v1" ? {pooling: "cls", normalize: false} : {} end |
Instance Method Details
#embed(texts) ⇒ Object
9 10 11 |
# File 'lib/informers/model.rb', line 9 def (texts) @model.(texts, **@options) end |