Class: Xberg::RerankerModelTypeCustom
- Inherits:
-
Data
- Object
- Data
- Xberg::RerankerModelTypeCustom
- 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
-
#additional_files ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#head ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#max_length ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#model_file ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#model_id ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#additional_files ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
851 852 853 |
# File 'lib/xberg/native.rb', line 851 def additional_files @additional_files end |
#head ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
851 852 853 |
# File 'lib/xberg/native.rb', line 851 def head @head end |
#max_length ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
851 852 853 |
# File 'lib/xberg/native.rb', line 851 def max_length @max_length end |
#model_file ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
851 852 853 |
# File 'lib/xberg/native.rb', line 851 def model_file @model_file end |
#model_id ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
851 852 853 |
# File 'lib/xberg/native.rb', line 851 def model_id @model_id end |
Class Method Details
.from_hash(hash) ⇒ Object
901 902 903 904 905 906 907 908 909 |
# File 'lib/xberg/native.rb', line 901 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"], head: hash[:head] || hash["head"] ) end |
Instance Method Details
#custom? ⇒ Boolean
893 |
# File 'lib/xberg/native.rb', line 893 def custom? = true |
#llm? ⇒ Boolean
895 |
# File 'lib/xberg/native.rb', line 895 def llm? = false |
#plugin? ⇒ Boolean
897 898 899 |
# File 'lib/xberg/native.rb', line 897 def plugin? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#preset? ⇒ Boolean
891 |
# File 'lib/xberg/native.rb', line 891 def preset? = false |