controller

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: 19 Imported by: 0

Documentation

Overview

Package controller This file contains the build controller which is responsible for building the project. Whenever a user wants to build the project, he will run the build command that uses the build controller. The build controller will install the needed build dependencies and build the project using the selected library (pyinstaller or nuitka). The final project will be built in the dist or the specified directory. The build controller also creates a symbolic link to the models folder if the user wants to.

Package controller This file contains the init controller which is responsible for initializing a new project. Whenever a user wants to create a new project, he will run the init command that uses the init controller. The init controller will create a new project folder with the given name. It will check if the user has python installed and clone the sdk into the project. After that, it will create a virtual environment, install the dependencies, and create the project files.

The final project folder should contain the following files: new-project/ ├── .gitignore ├── config.yaml ├── main.py ├── requirements.txt ├── sdk/ ├── models/ └── .venv/

Package controller This file contains the install controller which is responsible for installing an already existing project. Basically combining a slightly different init and the tidy controller features.

Whenever a user wants to install an existing project, he will clone an existing project. The existing project file structure should look like this: cloned-project/ ├── .gitignore ├── config.yaml ├── main.py ├── requirements.txt └── any user project related files However, if the user wants to run the project, there are some files missing. Here the install controller comes into play: - It will create a virtual environment - Clone the configured sdk version - Install the dependencies (requirements.txt & sdk/requirements.txt) - Install torch with cuda if the user wants to - Download the missing models - Generate the needed python code

In the end, the user should have a fully working project that should look like this: cloned-project/ ├── .gitignore ├── config.yaml ├── main.py ├── requirements.txt ├── sdk/ ├── models/ ├── .venv/ └── any user project related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunClean

func RunClean(allFlagDelete bool, authorizeAllDelete bool)

func RunUpgrade

func RunUpgrade(yes bool)

RunUpgrade upgrades the sdk version of a EMF project to the latest version.

Types

type BuildController

type BuildController struct {
	DestinationDir string
	CustomName     string
	OneFile        bool
	ModelsSymlink  bool
	Library        string
}

func (BuildController) Build

func (bc BuildController) Build(libraryPath string) (err error)

Build builds the project

func (BuildController) InstallDependencies

func (bc BuildController) InstallDependencies(library string) (string, error)

InstallDependencies installs the dependencies for the project returns the path to the python executable

func (BuildController) Run

func (bc BuildController) Run() error

Run runs the build command

type InitController

type InitController struct{}

func (InitController) Run

func (ic InitController) Run(args []string, useTorchCuda bool, customTag string) error

Run runs the init command

type InstallController

type InstallController struct{}

func (InstallController) Run

func (ic InstallController) Run(args []string, useTorchCuda bool, accessToken string) error

Run runs the install command

type TidyController

type TidyController struct{}

func (TidyController) RunTidy

func (tc TidyController) RunTidy(yes bool, accessToken string) error

Directories

Path Synopsis
Package tokenizer This file contains the remove tokenizer controller which is responsible for removing existing tokenizers in existing models
Package tokenizer This file contains the remove tokenizer controller which is responsible for removing existing tokenizers in existing models

Jump to

Keyboard shortcuts

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