Class: Xberg::SparseEmbeddingModelTypeCustom
- Inherits:
-
Data
- Object
- Data
- Xberg::SparseEmbeddingModelTypeCustom
- Extended by:
- T::Sig
- Includes:
- SparseEmbeddingModelType
- Defined in:
- lib/xberg/native.rb
Overview
Use a custom SPLADE (BertForMaskedLM) ONNX model from HuggingFace.
Instance Attribute Summary collapse
-
#additional_files ⇒ 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
999 1000 1001 |
# File 'lib/xberg/native.rb', line 999 def additional_files @additional_files end |
#max_length ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
999 1000 1001 |
# File 'lib/xberg/native.rb', line 999 def max_length @max_length end |
#model_file ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
999 1000 1001 |
# File 'lib/xberg/native.rb', line 999 def model_file @model_file end |
#model_id ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
999 1000 1001 |
# File 'lib/xberg/native.rb', line 999 def model_id @model_id end |
Class Method Details
.from_hash(hash) ⇒ Object
1029 1030 1031 1032 1033 1034 1035 1036 |
# File 'lib/xberg/native.rb', line 1029 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
1023 |
# File 'lib/xberg/native.rb', line 1023 def custom? = true |
#plugin? ⇒ Boolean
1025 1026 1027 |
# File 'lib/xberg/native.rb', line 1025 def plugin? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#preset? ⇒ Boolean
1021 |
# File 'lib/xberg/native.rb', line 1021 def preset? = false |