Documentation ¶
Overview ¶
Package primitive provides a primitive function in the application.
Package primitive provides a primitive function in the application.
Package primitive provides a primitive function in the application.
Index ¶
- Constants
- Variables
- func GetId() int64
- func Init(cfg *Config) (err error)
- func IsSameDomainValue(a, b DomainValue) bool
- func IsValidFramework(v string) bool
- func IsValidHardware(h string) bool
- func NewComputeFlavorVersion(flaver string, t string, version string) (ComputeFlavor, ComputeVersion, error)
- type Account
- type Activity
- type ActivityType
- type BaseImage
- type BigmodelType
- type ChoiceQuestion
- type City
- type Competition
- type CompetitionBonus
- type CompetitionDesc
- type CompetitionDuration
- type CompetitionHost
- type CompetitionIdentity
- type CompetitionIndex
- type CompetitionName
- type CompetitionPhase
- type CompetitionRepo
- type CompetitionScoreOrder
- type CompetitionStatus
- type CompetitionSubmission
- type CompetitionSubmissionInfo
- type CompetitionSummary
- type CompetitionTeam
- type CompetitionType
- type Competitor
- type CompetitorInfo
- type CompetitorName
- type CompetitorSummary
- type CompletionQuestion
- type Compute
- type ComputeFlavor
- type ComputeType
- type ComputeVersion
- type ComputilityType
- type Config
- type CoverId
- type CustomizedKey
- type CustomizedValue
- type Dataset
- type DatasetModifiableProperty
- type DatasetSummary
- type Directory
- type DomainTags
- type DomainValue
- type Email
- type Exception
- type FilePath
- type Finetune
- type FinetuneConfig
- type FinetuneIndex
- type FinetuneJob
- type FinetuneJobDetail
- type FinetuneJobInfo
- type FinetuneName
- type FinetuneParameter
- type FinetuneParameterConfig
- type FinetuneSummary
- type FinetuneUserInfo
- type Forum
- type Hardware
- type Identity
- type Input
- type InputeFilePath
- type JobDetail
- type JobInfo
- type KeyValue
- type Like
- type Login
- type LuoJiaRecord
- type LuoJiaRecordIndex
- type Model
- type ModelModifiableProperty
- type ModelSummary
- type Password
- type Phone
- type ProjType
- type ProtocolName
- type Province
- type Question
- type QuestionSubmission
- type QuestionSubmissionInfo
- type RelatedResources
- type RepoDownloadedEvent
- type RepoType
- type ResourceDesc
- type ResourceIndex
- type ResourceLevel
- type ResourceLikedEvent
- type ResourceName
- type ResourceObject
- type ResourceObjects
- type ResourceRef
- type ResourceSummary
- type ResourceTitle
- type ResourceType
- type ReverselyRelatedResourceInfo
- type SDKObject
- type SortType
- type Tags
- type TeamName
- type TeamRole
- type TrainingConfig
- type TrainingCreatedEvent
- type TrainingDesc
- type TrainingIndex
- type TrainingName
- type TrainingPlatform
- type TrainingSummary
- type URL
- type UserActivity
- type UserLike
- type UserLuoJiaRecord
- type UserSignedInEvent
- type UserTraining
- type Winners
- type WuKongPicture
- type WuKongPictureDesc
- type WuKongPictureLevel
- type WuKongPictureMeta
Constants ¶
const ( AIQuestionStatusStart = "start" AIQuestionStatusEnd = "end" )
const ( PyTorch = "pytorch" MindSpore = "mindspore" )
const ( RepoTypePublic = "public" RepoTypePrivate = "private" RepoTypeOnline = "online" )
const ( ResourceProject = "project" ResourceDataset = "dataset" ResourceModel = "model" SortTypeUpdateTime = "update_time" SortTypeFirstLetter = "first_letter" SortTypeDownloadCount = "download_count" )
const ( RelatedModelDisabled = "related_model_disabled" RelatedModelNotFound = "related_model_notfound" NoApplicationFile = "no_application_file" NoCompQuotaException = "no_comp_quota_exception" )
Variables ¶
var ( ActivityTypeFork = activityType(activityTypeFork) ActivityTypeLike = activityType(activityTypeLike) ActivityTypeCreate = activityType(activityTypeCreate) ActivityTypeDelete = activityType(activityTypeDelete) )
var ( BigmodelVQA = BigmodelType(bigmodelVQA) BigmodelPanGu = BigmodelType(bigmodelPanGu) BigmodelLuoJia = BigmodelType(bigmodelLuoJia) BigmodelWuKong = BigmodelType(bigmodelWuKong) BigmodelCodeGeex = BigmodelType(bigmodelCodeGeex) BigmodelGenPicture = BigmodelType(bigmodelGenPicture) BigmodelDescPicture = BigmodelType(bigmodelDescPicture) )
var ( CompetitionPhaseFinal = competitionPhase("final") CompetitionPhasePreliminary = competitionPhase("preliminary") )
var ( ReName = regexp.MustCompile("^[a-zA-Z0-9_-]+$") ResourceTypeProject = resourceType(ResourceProject) ResourceTypeModel = resourceType(ResourceModel) ResourceTypeDataset = resourceType(ResourceDataset) )
var ( ExceptionRelatedModelDisabled = exception(RelatedModelDisabled) ExceptionRelatedModelNotFound = exception(RelatedModelNotFound) ExceptionNoApplicationFile = exception(NoApplicationFile) )
var ExceptionMap = map[string]string{ RelatedModelDisabled: "the related model of space is disabled", RelatedModelNotFound: "the related model of space is not found", NoApplicationFile: "space no application file", NoCompQuotaException: "space no comp quota", }
Functions ¶
func GetId ¶ added in v1.5.0
func GetId() int64
GetId generates a unique identifier as an int64 value.
func IsSameDomainValue ¶
func IsSameDomainValue(a, b DomainValue) bool
func IsValidFramework ¶ added in v1.5.0
func IsValidHardware ¶ added in v1.5.0
func NewComputeFlavorVersion ¶
func NewComputeFlavorVersion(flaver string, t string, version string) (ComputeFlavor, ComputeVersion, error)
Types ¶
type Account ¶
type Account interface {
Account() string
}
Account
func CreateAccount ¶ added in v1.5.0
CreateAccount is usually called internally, such as repository.
func NewAccount ¶
type Activity ¶
type Activity struct { Type ActivityType Time int64 RepoType RepoType ResourceObject }
type ActivityType ¶
type ActivityType interface {
ActivityType() string
}
ActivityType
func NewActivityType ¶
func NewActivityType(v string) (ActivityType, error)
type BaseImage ¶ added in v1.5.0
Hardware is an interface that defines hardware-related operations.
func CreateBaseImage ¶ added in v1.5.0
CreateHardware creates a new Hardware instance based on the given string.
type ChoiceQuestion ¶
type Competition ¶
type Competition struct { CompetitionSummary Doc URL Forum Forum DatasetDoc URL DatasetURL URL Winners Winners Type CompetitionType Phase CompetitionPhase Enabled bool }
type CompetitionBonus ¶
type CompetitionBonus interface {
CompetitionBonus() int
}
CompetitionBonus
func NewCompetitionBonus ¶
func NewCompetitionBonus(v int) (CompetitionBonus, error)
type CompetitionDesc ¶
type CompetitionDesc interface {
CompetitionDesc() string
}
CompetitionDesc
func NewCompetitionDesc ¶
func NewCompetitionDesc(v string) (CompetitionDesc, error)
type CompetitionDuration ¶
type CompetitionDuration interface {
CompetitionDuration() string
}
CompetitionDuration
func NewCompetitionDuration ¶
func NewCompetitionDuration(v string) (CompetitionDuration, error)
type CompetitionHost ¶
type CompetitionHost interface {
CompetitionHost() string
}
func NewCompetitionHost ¶
func NewCompetitionHost(v string) (CompetitionHost, error)
type CompetitionIdentity ¶
type CompetitionIdentity interface {
CompetitionIdentity() string
}
CompetitionIdentity
func NewcompetitionIdentity ¶
func NewcompetitionIdentity(v string) (CompetitionIdentity, error)
type CompetitionIndex ¶
type CompetitionIndex struct { Id string Phase CompetitionPhase }
type CompetitionName ¶
type CompetitionName interface {
CompetitionName() string
}
CompetitionName
func NewCompetitionName ¶
func NewCompetitionName(v string) (CompetitionName, error)
type CompetitionPhase ¶
CompetitionPhase
func NewCompetitionPhase ¶
func NewCompetitionPhase(v string) (CompetitionPhase, error)
type CompetitionRepo ¶
type CompetitionRepo struct { TeamId string Individual Account Owner Account Repo ResourceName }
type CompetitionScoreOrder ¶
func NewCompetitionScoreOrder ¶
func NewCompetitionScoreOrder(b bool) CompetitionScoreOrder
type CompetitionStatus ¶
CompetitionStatus
func NewCompetitionStatus ¶
func NewCompetitionStatus(v string) (CompetitionStatus, error)
type CompetitionSubmission ¶
type CompetitionSubmission struct { Id string TeamId string Individual Account SubmitAt int64 OBSPath string Status string Score float32 }
func (*CompetitionSubmission) IsSuccess ¶
func (info *CompetitionSubmission) IsSuccess() bool
func (*CompetitionSubmission) IsTeamWork ¶
func (r *CompetitionSubmission) IsTeamWork() bool
func (*CompetitionSubmission) Key ¶
func (r *CompetitionSubmission) Key() string
type CompetitionSubmissionInfo ¶
func (*CompetitionSubmissionInfo) IsSuccess ¶
func (info *CompetitionSubmissionInfo) IsSuccess() bool
type CompetitionSummary ¶
type CompetitionSummary struct { Id string Name CompetitionName Desc CompetitionDesc Host CompetitionHost Bonus CompetitionBonus Status CompetitionStatus Duration CompetitionDuration Poster URL ScoreOrder CompetitionScoreOrder }
type CompetitionTeam ¶
type CompetitionType ¶
type CompetitionType interface {
CompetitionType() string
}
CompetitionType
func NewCompetitionType ¶
func NewCompetitionType(v string) (CompetitionType, error)
type Competitor ¶
type Competitor struct { CompetitorInfo Team CompetitionTeam TeamRole TeamRole }
type CompetitorInfo ¶
type CompetitorInfo struct { Account Account Name CompetitorName City City Email Email Phone Phone Identity CompetitionIdentity Province Province Detail map[string]string }
type CompetitorName ¶
type CompetitorName interface {
CompetitorName() string
}
CompetitorName
func NewCompetitorName ¶
func NewCompetitorName(v string) (CompetitorName, error)
type CompetitorSummary ¶
type CompletionQuestion ¶
type Compute ¶
type Compute struct { Type ComputeType Flavor ComputeFlavor Version ComputeVersion }
type ComputeType ¶
type ComputeType interface {
ComputeType() string
}
ComputeType
func NewComputeType ¶
func NewComputeType(v string) (ComputeType, error)
type ComputeVersion ¶
type ComputeVersion interface {
ComputeVersion() string
}
ComputeVersion
func NewComputeVersion ¶
func NewComputeVersion(v string) (ComputeVersion, error)
type ComputilityType ¶ added in v1.5.0
ComputilityType is an interface that defines computility hardware.
func CreateComputilityType ¶ added in v1.5.0
func CreateComputilityType(v string) ComputilityType
CreateComputilityType creates a new ComputilityType instance based on the given string.
func NewComputilityType ¶ added in v1.5.0
func NewComputilityType(v string) (ComputilityType, error)
NewComputilityType creates a new ComputilityType instance decided by sdk based on the given string.
type Config ¶
type Config struct { MaxBioLength int `json:"max_bio_length"` MaxNameLength int `json:"max_name_length"` MinNameLength int `json:"min_name_length"` MaxTitleLength int `json:"max_title_length"` MinTitleLength int `json:"min_title_length"` MaxDescLength int `json:"max_desc_length"` MaxNicknameLength int `json:"max_nickname_length"` MaxRelatedResourceNum int `json:"max_related_resource_num"` Covers []string `json:"covers" required:"true"` Protocols []string `json:"protocols" required:"true"` ProjectType []string `json:"project_type" required:"true"` TrainingPlatform []string `json:"training_platform" required:"true"` AvatarURL []string `json:"avatar_url" required:"true"` MaxTrainingNameLength int `json:"max_training_name_length"` MinTrainingNameLength int `json:"min_training_name_length"` MaxTrainingDescLength int `json:"max_training_desc_length"` MaxFinetuneNameLength int `json:"max_finetune_name_length"` MinFinetuneNameLength int `json:"min_finetune_name_length"` WuKongPictureMaxDescLength int `json:"wukong_picture_max_desc_length"` // Key is the finetue model name Finetunes map[string]FinetuneParameterConfig `json:"finetunes"` SDKObjects []SDKObject `json:"sdk"` BaseImages []baseImageConf `json:"base_image" required:"true"` // contains filtered or unexported fields }
var DomainConfig Config
func (*Config) HasAvatarURL ¶
func (*Config) SetDefault ¶
func (cfg *Config) SetDefault()
type CoverId ¶
type CoverId interface {
CoverId() string
}
TrainingPlatform
func NewCoverId ¶ added in v1.3.1
type CustomizedKey ¶
type CustomizedKey interface {
CustomizedKey() string
}
CustomizedKey
func NewCustomizedKey ¶
func NewCustomizedKey(v string) (CustomizedKey, error)
type CustomizedValue ¶
type CustomizedValue interface {
CustomizedValue() string
}
CustomizedValue
func NewCustomizedValue ¶
func NewCustomizedValue(v string) (CustomizedValue, error)
type Dataset ¶
type Dataset struct { Id string Owner Account Protocol ProtocolName DatasetModifiableProperty RepoId string CreatedAt int64 UpdatedAt int64 Version int // following fields is not under the controlling of version LikeCount int DownloadCount int RelatedModels RelatedResources RelatedProjects RelatedResources }
func (*Dataset) RelatedResources ¶
func (d *Dataset) RelatedResources() []ResourceObjects
func (*Dataset) ResourceIndex ¶
func (d *Dataset) ResourceIndex() ResourceIndex
func (*Dataset) ResourceObject ¶
func (d *Dataset) ResourceObject() (ResourceObject, RepoType)
type DatasetModifiableProperty ¶
type DatasetModifiableProperty struct { Name ResourceName Desc ResourceDesc Title ResourceTitle RepoType RepoType Tags []string TagKinds []string }
type DatasetSummary ¶
type DatasetSummary struct { Id string Owner Account Name ResourceName Desc ResourceDesc Title ResourceTitle Tags []string UpdatedAt int64 LikeCount int DownloadCount int }
type DomainTags ¶
func (*DomainTags) GetKindsOfTags ¶
func (t *DomainTags) GetKindsOfTags(tags []string) []string
type Exception ¶ added in v1.5.0
type Exception interface {
Exception() string
}
Exception is an interface that defines the exception of an object.
func CreateException ¶ added in v1.5.0
CreateException creates a new Exception instance based on the given string.
func NewException ¶ added in v1.5.0
NewException creates a new Exception instance based on the given string.
type Finetune ¶
type Finetune struct { Id string CreatedAt int64 FinetuneConfig // following fields is not under the controlling of version Job FinetuneJobInfo JobDetail FinetuneJobDetail }
type FinetuneConfig ¶
type FinetuneConfig struct { Name FinetuneName Param FinetuneParameter }
type FinetuneIndex ¶
type FinetuneJob ¶
type FinetuneJob struct { FinetuneJobInfo Status string }
type FinetuneJobDetail ¶
type FinetuneJobInfo ¶
type FinetuneName ¶
type FinetuneName interface {
FinetuneName() string
}
FinetuneName
func NewFinetuneName ¶
func NewFinetuneName(v string) (FinetuneName, error)
type FinetuneParameter ¶
type FinetuneParameter interface { Model() string Task() string Hyperparameters() map[string]string }
func NewFinetuneParameter ¶
func NewFinetuneParameter(model, task string, hyperparameters map[string]string) ( FinetuneParameter, error, )
type FinetuneParameterConfig ¶
type FinetuneSummary ¶
type FinetuneSummary struct { Id string Name FinetuneName CreatedAt int64 FinetuneJobDetail }
type FinetuneUserInfo ¶
type FinetuneUserInfo struct {
Expiry int64
}
type Hardware ¶ added in v1.5.0
Hardware is an interface that defines hardware-related operations.
func CreateHardware ¶ added in v1.5.0
CreateHardware creates a new Hardware instance based on the given string.
type Identity ¶ added in v1.5.0
Identity is an interface that represents an identity with both a string and integer representation.
func CreateIdentity ¶ added in v1.5.0
CreateIdentity creates a new Identity instance from an integer value.
func NewIdentity ¶ added in v1.5.0
NewIdentity creates a new Identity instance from a string value.
type Input ¶
type Input struct { Key CustomizedKey ResourceRef }
type InputeFilePath ¶
type InputeFilePath interface {
InputeFilePath() string
}
InputFilePath
func NewInputeFilePath ¶
func NewInputeFilePath(v string) (InputeFilePath, error)
type KeyValue ¶
type KeyValue struct { Key CustomizedKey Value CustomizedValue }
type Like ¶
type Like struct { CreatedAt int64 ResourceObject }
type LuoJiaRecord ¶
type LuoJiaRecordIndex ¶
type Model ¶
type Model struct { Id string Owner Account Protocol ProtocolName ModelModifiableProperty RepoId string RelatedDatasets RelatedResources CreatedAt int64 UpdatedAt int64 Version int // following fields is not under the controlling of version LikeCount int DownloadCount int RelatedProjects RelatedResources }
func (*Model) MaxRelatedResourceNum ¶
func (*Model) RelatedResources ¶
func (m *Model) RelatedResources() []ResourceObjects
func (*Model) ResourceIndex ¶
func (m *Model) ResourceIndex() ResourceIndex
func (*Model) ResourceObject ¶
func (m *Model) ResourceObject() (ResourceObject, RepoType)
type ModelModifiableProperty ¶
type ModelModifiableProperty struct { Name ResourceName Desc ResourceDesc Title ResourceTitle RepoType RepoType Tags []string TagKinds []string }
type ModelSummary ¶
type ModelSummary struct { Id string Owner Account Name ResourceName Desc ResourceDesc Title ResourceTitle Tags []string UpdatedAt int64 LikeCount int DownloadCount int }
type ProtocolName ¶
type ProtocolName interface {
ProtocolName() string
}
ProtocolName
func NewProtocolName ¶
func NewProtocolName(v string) (ProtocolName, error)
type QuestionSubmission ¶
type QuestionSubmissionInfo ¶
type RelatedResources ¶
type RelatedResources []ResourceIndex
func (RelatedResources) Count ¶
func (r RelatedResources) Count() int
func (RelatedResources) Has ¶
func (r RelatedResources) Has(index *ResourceIndex) bool
type RepoDownloadedEvent ¶
type RepoDownloadedEvent struct { Account Account Name string RepoId string Obj ResourceObject }
type ResourceDesc ¶
type ResourceDesc interface { ResourceDesc() string DomainValue }
ResourceDesc
func NewResourceDesc ¶
func NewResourceDesc(v string) (ResourceDesc, error)
type ResourceIndex ¶
type ResourceLevel ¶
ResourceLevel
func NewResourceLevel ¶
func NewResourceLevel(v string) ResourceLevel
func NewResourceLevelByNum ¶
func NewResourceLevelByNum(v int) ResourceLevel
type ResourceLikedEvent ¶
type ResourceLikedEvent struct { Account Account Obj ResourceObject }
type ResourceName ¶
Name
func NewEmptyResourceName ¶
func NewEmptyResourceName() ResourceName
func NewResourceName ¶
func NewResourceName(v string) (ResourceName, error)
type ResourceObject ¶
type ResourceObject struct { Type ResourceType ResourceIndex }
ResourceObject
func (*ResourceObject) String ¶
func (r *ResourceObject) String() string
type ResourceObjects ¶
type ResourceObjects struct { Type ResourceType Objects []ResourceIndex }
type ResourceRef ¶
type ResourceRef struct { User Account Type ResourceType RepoId string File InputeFilePath Name ResourceName }
type ResourceSummary ¶
type ResourceSummary struct { Owner Account Name ResourceName Id string RepoId string RepoType RepoType }
func (*ResourceSummary) IsOnline ¶
func (s *ResourceSummary) IsOnline() bool
func (*ResourceSummary) IsPrivate ¶
func (s *ResourceSummary) IsPrivate() bool
func (*ResourceSummary) IsPublic ¶
func (s *ResourceSummary) IsPublic() bool
func (*ResourceSummary) ResourceIndex ¶
func (s *ResourceSummary) ResourceIndex() ResourceIndex
type ResourceTitle ¶
type ResourceTitle interface { ResourceTitle() string DomainValue }
ResourceTitle
func NewResourceTitle ¶
func NewResourceTitle(v string) (ResourceTitle, error)
type ResourceType ¶
type ResourceType interface {
ResourceType() string
}
ResourceType
func NewResourceType ¶
func NewResourceType(v string) (ResourceType, error)
type ReverselyRelatedResourceInfo ¶
type ReverselyRelatedResourceInfo struct { Promoter *ResourceIndex Resource *ResourceIndex }
type TrainingConfig ¶
type TrainingConfig struct { ProjectName ResourceName ProjectRepoId string Name TrainingName Desc TrainingDesc CodeDir Directory BootFile FilePath Hyperparameters []KeyValue Env []KeyValue Inputs []Input EnableOutput bool EnableAim bool Compute Compute }
type TrainingCreatedEvent ¶
type TrainingCreatedEvent struct { Account Account TrainingIndex TrainingIndex TrainingInputs []Input }
training
type TrainingDesc ¶
type TrainingDesc interface {
TrainingDesc() string
}
TrainingDesc
func NewTrainingDesc ¶
func NewTrainingDesc(v string) (TrainingDesc, error)
type TrainingIndex ¶
type TrainingIndex struct { Project ResourceIndex TrainingId string }
type TrainingName ¶
type TrainingName interface {
TrainingName() string
}
TrainingName
func NewTrainingName ¶
func NewTrainingName(v string) (TrainingName, error)
type TrainingPlatform ¶
type TrainingPlatform interface {
TrainingPlatform() string
}
TrainingPlatform
func NewTrainingPlatform ¶
func NewTrainingPlatform(v string) (TrainingPlatform, error)
type TrainingSummary ¶
type TrainingSummary struct { Id string Name TrainingName Desc TrainingDesc Error string Status string Duration int CreatedAt int64 }
type UserLuoJiaRecord ¶
type UserLuoJiaRecord struct { User Account LuoJiaRecord }
type UserSignedInEvent ¶
type UserSignedInEvent struct {
Account Account
}
type UserTraining ¶
type WuKongPicture ¶
type WuKongPicture struct { Id string Owner Account OBSPath string Level WuKongPictureLevel Diggs []string DiggCount int Version int CreatedAt string WuKongPictureMeta }
type WuKongPictureDesc ¶
type WuKongPictureDesc interface {
WuKongPictureDesc() string
}
WuKongPictureDesc
func NewWuKongPictureDesc ¶
func NewWuKongPictureDesc(v string) (WuKongPictureDesc, error)
type WuKongPictureLevel ¶
wukong level
func NewWuKongPictureLevel ¶
func NewWuKongPictureLevel(v string) WuKongPictureLevel
func NewWuKongPictureLevelByNum ¶
func NewWuKongPictureLevelByNum(v int) WuKongPictureLevel
type WuKongPictureMeta ¶
type WuKongPictureMeta struct { Style string Desc WuKongPictureDesc }
Source Files ¶
- activity.go
- ai_question.go
- base_image.go
- bigmodel.go
- competition.go
- computility_type.go
- config.go
- dataset.go
- dp_bigmodel.go
- dp_competition.go
- dp_finetune.go
- dp_project.go
- dp_resource.go
- dp_training.go
- dp_user.go
- event.go
- exception.go
- finetune.go
- identity.go
- like.go
- login.go
- model.go
- resource.go
- snowflake.go
- tags.go
- training.go