Documentation ¶
Index ¶
- Constants
- Variables
- func ArtiVCClone(dir string, modelConfig datamodel.ArtiVCModelConfiguration, ...) error
- func ArtiVCGetTags(dir string, config datamodel.ArtiVCModelConfiguration) ([]string, error)
- func ConvertAllJSONEnumValueToProtoStyle(enumRegistry map[string]map[string]int32, i interface{})
- func ConvertAllJSONKeySnakeCase(i interface{})
- func CopyModelFileToModelRepository(modelRepository string, dir string, tritonModels []datamodel.TritonModel) error
- func DoSupportBatch(configFilePath string) (bool, error)
- func GenerateHuggingFaceModel(confDir string, dest string, modelId string) error
- func GitHubCloneWLargeFile(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
- func GitHubCloneWOLargeFile(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
- func HasModelWeightFile(modelRepository string, tritonModels []datamodel.TritonModel) bool
- func HuggingFaceClone(dir string, modelConfig datamodel.HuggingFaceModelConfiguration) error
- func HuggingFaceExport(dir string, modelConfig datamodel.HuggingFaceModelConfiguration, ...) error
- func RemoveModelRepository(modelRepositoryRoot string, namespace string, modelName string, ...)
- func UpdateConfigModelName(filePath string, oldModelName string, newModelName string) error
- func UpdateModelConfig(modelRepository string, tritonModels []datamodel.TritonModel) error
- func ValidateFilePath(filePath string) error
- type GitHubInfo
- type ModelMeta
- type Tag
Constants ¶
View Source
const ( KB = 1 << (10 * iota) MB GB TB )
View Source
const DEFAULT_GCP_SERVICE_ACCOUNT_FILE = "https://artifacts.instill.tech/default-service-account.json"
View Source
const MaxBatchSize int = 32
View Source
const MaxImageSizeBytes int = 4 * MB
Variables ¶
View Source
var MarshalOptions protojson.MarshalOptions = protojson.MarshalOptions{ UseProtoNames: true, EmitUnpopulated: true, UseEnumNumbers: false, }
View Source
var Tags = map[string]modelPB.ModelInstance_Task{ "CLASSIFICATION": modelPB.ModelInstance_TASK_CLASSIFICATION, "DETECTION": modelPB.ModelInstance_TASK_DETECTION, "IMAGE-CLASSIFICATION": modelPB.ModelInstance_TASK_CLASSIFICATION, "IMAGE-DETECTION": modelPB.ModelInstance_TASK_DETECTION, }
View Source
var Tasks = map[string]modelPB.ModelInstance_Task{ "TASK_CLASSIFICATION": modelPB.ModelInstance_TASK_CLASSIFICATION, "TASK_DETECTION": modelPB.ModelInstance_TASK_DETECTION, "TASK_KEYPOINT": modelPB.ModelInstance_TASK_KEYPOINT, }
View Source
var UnmarshalOptions protojson.UnmarshalOptions = protojson.UnmarshalOptions{ DiscardUnknown: true, }
View Source
var Visibility = map[string]modelPB.Model_Visibility{ "public": modelPB.Model_VISIBILITY_PUBLIC, "private": modelPB.Model_VISIBILITY_PRIVATE, }
Functions ¶
func ArtiVCClone ¶
func ArtiVCClone(dir string, modelConfig datamodel.ArtiVCModelConfiguration, instanceConfig datamodel.ArtiVCModelInstanceConfiguration) error
func ArtiVCGetTags ¶
func ArtiVCGetTags(dir string, config datamodel.ArtiVCModelConfiguration) ([]string, error)
func ConvertAllJSONEnumValueToProtoStyle ¶
ConvertAllJSONEnumValueToProtoStyle converts lowercase enum value to the Protobuf naming convention where the enum type is always prefixed and is UPPERCASE snake_case. For examples: - api in a Protobuf `Enum SourceType` type will be converted to SOURCE_TYPE_API - oauth2.0 in a Protobuf `Enum AuthFlowType` type will be converted to AUTH_FLOW_TYPE_OAUTH2_0
func ConvertAllJSONKeySnakeCase ¶
func ConvertAllJSONKeySnakeCase(i interface{})
ConvertAllJSONKeySnakeCase traverses a JSON object to replace all keys to snake_case.
func CopyModelFileToModelRepository ¶
func CopyModelFileToModelRepository(modelRepository string, dir string, tritonModels []datamodel.TritonModel) error
func DoSupportBatch ¶
func GitHubCloneWLargeFile ¶
func GitHubCloneWLargeFile(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
func GitHubCloneWOLargeFile ¶
func GitHubCloneWOLargeFile(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
func HasModelWeightFile ¶
func HasModelWeightFile(modelRepository string, tritonModels []datamodel.TritonModel) bool
func HuggingFaceClone ¶
func HuggingFaceClone(dir string, modelConfig datamodel.HuggingFaceModelConfiguration) error
func HuggingFaceExport ¶
func HuggingFaceExport(dir string, modelConfig datamodel.HuggingFaceModelConfiguration, modelId string) error
func RemoveModelRepository ¶
func UpdateConfigModelName ¶
func UpdateModelConfig ¶
func UpdateModelConfig(modelRepository string, tritonModels []datamodel.TritonModel) error
func ValidateFilePath ¶
validate to prevent security issue as https://codeql.github.com/codeql-query-help/go/go-path-injection/
Types ¶
type GitHubInfo ¶
type GitHubInfo struct { Description string `json:"description"` Visibility string `json:"visibility"` Tags []Tag }
func GetGitHubRepoInfo ¶
func GetGitHubRepoInfo(repo string) (GitHubInfo, error)
type ModelMeta ¶
func GetModelMetaFromReadme ¶
Click to show internal directories.
Click to hide internal directories.