cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2022 Mohamed Hammad Youssef mmhy2003@hotmail.com

Index

Constants

View Source
const HFAPIEndpoint = "https://api-inference.huggingface.co/models/bigscience/bloom"
View Source
const ShellToUse = "bash"

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func LoadPromptContext

func LoadPromptContext() string

func ProcessResult

func ProcessResult(result HFResult, prompt string) string

func RunCommand added in v0.0.3

func RunCommand(command string)

func ShellOut added in v0.0.3

func ShellOut(command string) (error, string, string)

Types

type HFResult

type HFResult struct {
	GeneratedText string `json:"generated_text,omitempty"`
}

func GetResult

func GetResult(prompt string) HFResult

type OptionsStruct

type OptionsStruct struct {
	UseCache     bool `json:"use_cache,omitempty"`
	WaitForModel bool `json:"wait_for_model,omitempty"`
}

type ParametersStruct

type ParametersStruct struct {
	MaxNewTokens      int     `json:"max_new_tokens,omitempty"`
	TopK              float32 `json:"top_k,omitempty"`
	TopP              float32 `json:"top_p,omitempty"`
	Temperature       float32 `json:"temperature,omitempty"`
	DoSample          bool    `json:"do_sample,omitempty"`
	Seed              int     `json:"seed,omitempty"`
	EarlyStopping     bool    `json:"early_stopping,omitempty"`
	NoRepeatNgramSize int     `json:"no_repeat_ngram_size,omitempty"`
	NumBeams          int     `json:"num_beams,omitempty"`
	ReturnFullText    bool    `json:"return_full_text,omitempty"`
}

type RequestStruct

type RequestStruct struct {
	Inputs     string           `json:"inputs,omitempty"`
	Parameters ParametersStruct `json:"parameters,omitempty"`
	Options    OptionsStruct    `json:"options,omitempty"`
}

Jump to

Keyboard shortcuts

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