github.com/weaviate/weaviate@v1.24.6/modules/text2vec-huggingface/config.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package modhuggingface
    13  
    14  import (
    15  	"context"
    16  
    17  	"github.com/weaviate/weaviate/entities/models"
    18  	"github.com/weaviate/weaviate/entities/modulecapabilities"
    19  	"github.com/weaviate/weaviate/entities/moduletools"
    20  	"github.com/weaviate/weaviate/entities/schema"
    21  	"github.com/weaviate/weaviate/modules/text2vec-huggingface/vectorizer"
    22  )
    23  
    24  func (m *HuggingFaceModule) ClassConfigDefaults() map[string]interface{} {
    25  	return map[string]interface{}{
    26  		"vectorizeClassName": vectorizer.DefaultVectorizeClassName,
    27  	}
    28  }
    29  
    30  func (m *HuggingFaceModule) PropertyConfigDefaults(
    31  	dt *schema.DataType,
    32  ) map[string]interface{} {
    33  	return map[string]interface{}{
    34  		"skip":                  !vectorizer.DefaultPropertyIndexed,
    35  		"vectorizePropertyName": vectorizer.DefaultVectorizePropertyName,
    36  	}
    37  }
    38  
    39  func (m *HuggingFaceModule) ValidateClass(ctx context.Context,
    40  	class *models.Class, cfg moduletools.ClassConfig,
    41  ) error {
    42  	settings := vectorizer.NewClassSettings(cfg)
    43  	return settings.Validate(class)
    44  }
    45  
    46  var _ = modulecapabilities.ClassConfigurator(New())