downloadermodel

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScriptPath         = "sdk/downloader.py"
	TagPrefix          = "--"
	ModelName          = "model-name"
	ModelModule        = "model-module"
	Path               = "path"
	ModelClass         = "model-class"
	ModelOptions       = "model-options"
	TokenizerClass     = "tokenizer-class"
	TokenizerOptions   = "tokenizer-options"
	Overwrite          = "overwrite"
	Skip               = "skip"
	SkipValueModel     = "model"
	SkipValueTokenizer = "tokenizer"
	EmfClient          = "emf-client"
	OnlyConfiguration  = "only-configuration"
	AccessToken        = "access-token"
)

Constants related to the downloader script python arguments.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	ModelName         string
	ModelModule       string
	ModelClass        string
	ModelOptions      []string
	TokenizerClass    string
	TokenizerOptions  []string
	SkipTokenizer     bool
	SkipModel         bool
	OnlyConfiguration bool
	DirectoryPath     string
	AccessToken       string
}

Args represents the arguments for the script.

func (*Args) ToCobra

func (a *Args) ToCobra(cmd *cobra.Command)

ToCobra builds the arguments for running the cobra command

func (*Args) ToCobraTokenizer added in v0.0.2

func (a *Args) ToCobraTokenizer(cmd *cobra.Command)

ToCobraTokenizer builds the arguments for running the cobra command

func (*Args) ToPython

func (a *Args) ToPython() []string

ToPython builds the arguments for running the python script. Pre-condition : certain that the user authorized the overwriting when downloading the model.

func (*Args) Validate

func (a *Args) Validate() error

Validate validates the mandatory fields for Args

type Model

type Model struct {
	Path      string            `json:"path"`
	Module    string            `json:"module"`
	Class     string            `json:"class"`
	Options   map[string]string `json:"options"`
	Tokenizer Tokenizer         `json:"tokenizer"`
	IsEmpty   bool
}

Model represents a model returned by the downloader script.

func (*Model) Empty

func (m *Model) Empty() bool

Empty checks if a Model is empty.

type Tokenizer

type Tokenizer struct {
	Path    string            `json:"path"`
	Class   string            `json:"class"`
	Options map[string]string `json:"options"`
}

Tokenizer represents a tokenizer returned by the downloader script.

func (*Tokenizer) Empty

func (t *Tokenizer) Empty() bool

Empty checks if a Tokenizer is empty.

Jump to

Keyboard shortcuts

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