util

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateName

func GenerateName(name string) string

func SetAdd

func SetAdd(values []string, value string) []string

func SetContains

func SetContains[T comparable](values []T, value T) bool

func SetRemove

func SetRemove(values []string, value string) []string

func SliceDiff

func SliceDiff(old []string, new []string) (toDelete []string, toAdd []string)

toDelete includes string in old but not in new, toAdd includes string in new but not in old.

func SliceIn

func SliceIn(slice []string, value string) bool

func TopNIndices

func TopNIndices(arr []float32, n int) []int32

Get the top-n indices from the arr.

Types

type ObjectBody

type ObjectBody struct {
	Path string `json:"path"`
	Type string `json:"type"`
	Oid  string `json:"oid"`
	Size int64  `json:"size"`
}

func ListRepoObjects

func ListRepoObjects(repoID string, revision string) (bodies []*ObjectBody, err error)

TODO: support modelScope as well.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL