Documentation
¶
Index ¶
- type ClipService
- func (c *ClipService) GetEmbeddingFromText(text string, translate bool) (embedding []float32, err error)
- func (c *ClipService) GetEmbeddings(toEmbedObjects []EmbeddingReqObject) (embeddings []EmbeddingResObject, err error)
- func (c *ClipService) GetNsfwScores(imageUrls []string) (scores []float32, err error)
- func (c *ClipService) RoundTrip(r *http.Request) (*http.Response, error)
- type EmbeddingReqObject
- type EmbeddingResObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClipService ¶
type ClipService struct { SafetyChecker *translator.TranslatorSafetyChecker // contains filtered or unexported fields }
func NewClipService ¶
func NewClipService(redis *database.RedisWrapper, safetyChecker *translator.TranslatorSafetyChecker) *ClipService
func (*ClipService) GetEmbeddingFromText ¶
func (c *ClipService) GetEmbeddingFromText(text string, translate bool) (embedding []float32, err error)
GetEmbeddingFromText, retry up to retries times
func (*ClipService) GetEmbeddings ¶
func (c *ClipService) GetEmbeddings(toEmbedObjects []EmbeddingReqObject) (embeddings []EmbeddingResObject, err error)
func (*ClipService) GetNsfwScores ¶
func (c *ClipService) GetNsfwScores(imageUrls []string) (scores []float32, err error)
type EmbeddingReqObject ¶
type EmbeddingResObject ¶
type EmbeddingResObject struct { Input EmbeddingReqObject `json:"input"` Embedding []float32 `json:"embedding"` AestheticScore *responses.ClipAestheticScore `json:"aesthetic_score,omitempty"` NsfwScore *responses.NsfwCheckScore `json:"nsfw_score,omitempty"` }
Click to show internal directories.
Click to hide internal directories.