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 DoSupportBatch(configFilePath string) (bool, error)
- func GitHubClone(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
- func RemoveModelRepository(modelRepositoryRoot string, namespace string, modelName string, ...)
- 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 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 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 DoSupportBatch ¶
func GitHubClone ¶
func GitHubClone(dir string, instanceConfig datamodel.GitHubModelInstanceConfiguration) error
func RemoveModelRepository ¶
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.