nimparser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackendTypeTensorRT indicates tensortt backend
	BackendTypeTensorRT = "tensorrt"
)

Variables

This section is empty.

Functions

func MatchProfiles

func MatchProfiles(modelSpec appsv1alpha1.ModelSpec, manifest NIMManifest, discoveredGPUs []string) ([]string, error)

MatchProfiles matches the given model parameters with the profiles in the manifest

Types

type Component

type Component struct {
	Dst string `yaml:"dst" json:"dst,omitempty"`
	Src Src    `yaml:"src" json:"src,omitempty"`
}

Component represents source and destination for model files

type File

type File struct {
	Name string `yaml:"name" json:"name,omitempty"`
}

File represents the model files

func (*File) UnmarshalYAML

func (f *File) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshalls given yaml data into NIM manifest struct

type NIMManifest

type NIMManifest map[string]NIMProfile

NIMManifest is the model manifest file

func ParseModelManifest

func ParseModelManifest(filePath string) (*NIMManifest, error)

ParseModelManifest parses the given NIM manifest yaml file

func ParseModelManifestFromRawOutput

func ParseModelManifestFromRawOutput(data []byte) (*NIMManifest, error)

ParseModelManifestFromRawOutput parses the given raw NIM manifest data

type NIMProfile

type NIMProfile struct {
	Model        string            `yaml:"model" json:"model,omitempty"`
	Release      string            `yaml:"release" json:"release,omitempty"`
	Tags         map[string]string `yaml:"tags" json:"tags,omitempty"`
	ContainerURL string            `yaml:"container_url" json:"container_url,omitempty"`
	Workspace    Workspace         `yaml:"workspace" json:"workspace,omitempty"`
}

NIMProfile is the model profile supported by the NIM container

type Src

type Src struct {
	RepoID string `yaml:"repo_id" json:"repo_id,omitempty"`
	Files  []File `yaml:"files" json:"files,omitempty"`
}

Src represents model source

func (*Src) UnmarshalYAML

func (s *Src) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is the custom unmarshal function for Src

type Workspace

type Workspace struct {
	Components []Component `yaml:"components" json:"components,omitempty"`
}

Workspace represents workspace for model components

Jump to

Keyboard shortcuts

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