Class: Xberg::EmbeddingModelTypeCustom

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
EmbeddingModelType
Defined in:
lib/xberg/native.rb

Overview

Use a custom ONNX model from HuggingFace

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dimensionsObject (readonly)

Returns the value of attribute dimensions

Returns:

  • (Object)

    the current value of dimensions



1167
1168
1169
# File 'lib/xberg/native.rb', line 1167

def dimensions
  @dimensions
end

#model_idObject (readonly)

Returns the value of attribute model_id

Returns:

  • (Object)

    the current value of model_id



1167
1168
1169
# File 'lib/xberg/native.rb', line 1167

def model_id
  @model_id
end

Class Method Details

.from_hash(hash) ⇒ Object



1188
1189
1190
# File 'lib/xberg/native.rb', line 1188

def self.from_hash(hash)
  new(model_id: hash[:model_id] || hash["model_id"], dimensions: hash[:dimensions] || hash["dimensions"])
end

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


1180
# File 'lib/xberg/native.rb', line 1180

def custom? = true

#llm?Boolean

Returns:

  • (Boolean)


1182
# File 'lib/xberg/native.rb', line 1182

def llm? = false

#plugin?Boolean

Returns:

  • (Boolean)


1184
1185
1186
# File 'lib/xberg/native.rb', line 1184

def plugin? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]

#preset?Boolean

Returns:

  • (Boolean)


1178
# File 'lib/xberg/native.rb', line 1178

def preset? = false