Class: Xberg::RerankerModelTypeCustom

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

Overview

Use a custom ONNX cross-encoder from HuggingFace.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#additional_filesObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



598
599
600
# File 'lib/xberg/native.rb', line 598

def additional_files
  @additional_files
end

#max_lengthObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



598
599
600
# File 'lib/xberg/native.rb', line 598

def max_length
  @max_length
end

#model_fileObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



598
599
600
# File 'lib/xberg/native.rb', line 598

def model_file
  @model_file
end

#model_idObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



598
599
600
# File 'lib/xberg/native.rb', line 598

def model_id
  @model_id
end

Class Method Details

.from_hash(hash) ⇒ Object



636
637
638
# File 'lib/xberg/native.rb', line 636

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

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


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

def custom? = true

#llm?Boolean

Returns:

  • (Boolean)


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

def llm? = false

#plugin?Boolean

Returns:

  • (Boolean)


632
633
634
# File 'lib/xberg/native.rb', line 632

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

#preset?Boolean

Returns:

  • (Boolean)


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

def preset? = false