Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
GetModel(token, owner, name string) (*api.Model, error)
CreateVersion(token, modelOwner, modelName, containerImageDigest, releaseNotes string,
schemas map[string]any) (*api.Version, error)
}
API defines the interface for interacting with WriftAI's API v1.
type Console ¶
type Console interface {
Infof(format string, a ...interface{})
Info(message string)
Warning(message string)
Warningf(format string, a ...interface{})
Debugf(format string, a ...interface{})
}
Console defines the interface to output formatted messages
type Docker ¶
type Docker interface {
Build(dockerfileContent, imageName, platform, buildContext string) error
Push(imageName string) (string, error)
Run(imageName, platform, containerName string, rm,
detach bool, gpus string, envVars, ports, volumes,
command []string) (string, error)
}
Docker defines the interface for interacting with the Docker CLI.
If the required GPU driver is not available, implementations of model.Docker.Run must return docker.ErrMissingGPUDriver.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the struct used to handle model related operations.
func NewModel ¶
func NewModel(api API, project Project, docker Docker, console Console, config *config.Config, wriftAIModelWheelName string, wriftAIModelWheelContent []byte) *Model
NewModel creates and returns a new Model struct instance.
func (*Model) Push ¶
Push pushes the model by building and pushing it to WriftAI's registry and creating a new version of it by calling WriftAI's API.
token is the user's authorization token to make calls to WriftAI's API. releaseNotes is a string containing release notes for the new version.
Returns an error if push fails.