model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetDockerCPU = "docker-cpu"
	TargetDockerGPU = "docker-gpu"
)

Variables

View Source
var CUDABaseImages []CUDABaseImage
View Source
var TFCompatibilityMatrix []TFCompatibility
View Source
var TorchCompatibilityMatrix []TorchCompatibility

Functions

func CUDABaseImageFor

func CUDABaseImageFor(cuda string, cuDNN string) (string, error)

Types

type ArgumentType

type ArgumentType string
const (
	ArgumentTypeString ArgumentType = "str"
	ArgumentTypeInt    ArgumentType = "int"
	ArgumentTypeFloat  ArgumentType = "float"
	ArgumentTypeBool   ArgumentType = "bool"
	ArgumentTypePath   ArgumentType = "Path"
)

type CUDABaseImage

type CUDABaseImage struct {
	Tag     string
	CUDA    string
	CuDNN   string
	IsDevel bool
	Ubuntu  string
}

func (*CUDABaseImage) ImageTag

func (i *CUDABaseImage) ImageTag() string

func (*CUDABaseImage) UnmarshalJSON

func (i *CUDABaseImage) UnmarshalJSON(data []byte) error

type Config

type Config struct {
	Environment *Environment `json:"environment" yaml:"environment"`
	Model       string       `json:"model" yaml:"model"`
	Examples    []*Example   `json:"examples" yaml:"examples"`
	Workdir     string       `json:"workdir" yaml:"workdir"`
}

func ConfigFromYAML

func ConfigFromYAML(contents []byte) (*Config, error)

func DefaultConfig

func DefaultConfig() *Config

func (*Config) CUDABaseImageTag

func (c *Config) CUDABaseImageTag() (string, error)

func (*Config) HasCPU

func (c *Config) HasCPU() bool

func (*Config) HasGPU

func (c *Config) HasGPU() bool

func (*Config) PythonPackagesForArch

func (c *Config) PythonPackagesForArch(arch string, goos string, goarch string) (packages []string, indexURLs []string, err error)

func (*Config) ValidateAndCompleteConfig

func (c *Config) ValidateAndCompleteConfig() error

type Environment

type Environment struct {
	PythonVersion        string   `json:"python_version" yaml:"python_version"`
	PythonRequirements   string   `json:"python_requirements" yaml:"python_requirements"`
	PythonExtraIndexURLs []string `json:"python_extra_index_urls" yaml:"python_extra_index_urls"`
	PythonFindLinks      []string `json:"python_find_links" yaml:"python_find_links"`
	PythonPackages       []string `json:"python_packages" yaml:"python_packages"`
	SystemPackages       []string `json:"system_packages" yaml:"system_packages"`
	PreInstall           []string `json:"pre_install" yaml:"pre_install"`
	Architectures        []string `json:"architectures" yaml:"architectures"`
	CUDA                 string   `json:"cuda" yaml:"cuda"`
	CuDNN                string   `json:"cudnn" yaml:"cudnn"`
	BuildRequiresGPU     bool     `json:"build_requires_gpu" yaml:"build_requires_gpu"`
}

type Example

type Example struct {
	Input  map[string]string `json:"input" yaml:"input"`
	Output string            `json:"output" yaml:"output"`
}

type Image

type Image struct {
	URI          string                  `json:"uri"`
	Created      time.Time               `json:"created"`
	Arch         string                  `json:"arch"`
	RunArguments map[string]*RunArgument `json:"run_arguments"`
	TestStats    *Stats                  `json:"test_stats"`
	BuildFailed  bool                    `json:"build_failed"`
}

func ImageForArch

func ImageForArch(images []*Image, arch string) *Image

type Model

type Model struct {
	Host string `json:"host"`
	User string `json:"user"`
	Name string `json:"name"`
}

func (*Model) String

func (m *Model) String() string

type RunArgument

type RunArgument struct {
	Type    ArgumentType `json:"type"`
	Default *string      `json:"default"`
	Min     *string      `json:"min"`
	Max     *string      `json:"max"`
	Options *[]string    `json:"options"`
	Help    *string      `json:"help"`
}

type Stats

type Stats struct {
	BootTime    float64 `json:"boot_time"`
	SetupTime   float64 `json:"setup_time"`
	RunTime     float64 `json:"run_time"`
	MemoryUsage uint64  `json:"memory_usage"`
	CPUUsage    float64 `json:"cpu_usage"`
}

type TFCompatibility

type TFCompatibility struct {
	TF           string
	TFCPUPackage string
	TFGPUPackage string
	CUDA         string
	CuDNN        string
	Pythons      []string
}

func (*TFCompatibility) UnmarshalJSON

func (compat *TFCompatibility) UnmarshalJSON(data []byte) error

type TorchCompatibility

type TorchCompatibility struct {
	Torch       string
	Torchvision string
	Torchaudio  string
	IndexURL    string
	CUDA        *string
	Pythons     []string
}

func (*TorchCompatibility) TorchVersion

func (c *TorchCompatibility) TorchVersion() string

func (*TorchCompatibility) TorchvisionVersion

func (c *TorchCompatibility) TorchvisionVersion() string

type Version

type Version struct {
	ID       string            `json:"id"`
	Config   *Config           `json:"config"`
	Created  time.Time         `json:"created"`
	BuildIDs map[string]string `json:"build_ids"`
}

Jump to

Keyboard shortcuts

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