bigmodels

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CodeInputTextAuditError     = "code_input_text_audit_error"
	CodeOutputTextAuditError    = "code_output_text_audit_error"
	CodeBaiChuanGenerationError = "code_baichuan_generation_error"
)

Variables

This section is empty.

Functions

func Init

func Init(cfg *Config) error

func IsErrorConcurrentRequest

func IsErrorConcurrentRequest(err error) bool

func NewBigModelService

func NewBigModelService() bigmodel.BigModel

func NewErrorConcurrentRequest

func NewErrorConcurrentRequest(err error) errorConcurrentRequest

Types

type ApiService

type ApiService struct {
	TokenExpire string
}

type CloudConfig

type CloudConfig struct {
	Domain       string `json:"domain"                 required:"true"`
	User         string `json:"user"                   required:"true"`
	Password     string `json:"password"               required:"true"`
	Project      string `json:"project"                required:"true"`
	AuthEndpoint string `json:"auth_endpoint"          required:"true"`
}

type Config

type Config struct {
	OBS        OBSConfig   `json:"obs"             required:"true"`
	Cloud      CloudConfig `json:"cloud"           required:"true"`
	WuKong     WuKong      `json:"wukong"          required:"true"`
	Endpoints  Endpoints   `json:"endpoints"       required:"true"`
	Moderation Moderation  `json:"moderation"      required:"true"`
	CloudGY    CloudConfig `json:"auth_gy"         required:"true"`

	MaxPictureSizeToDescribe int64 `json:"max_picture_size_to_describe"`
	MaxPictureSizeToVQA      int64 `json:"max_picture_size_to_vqa"`
}

func (*Config) SetDefault

func (cfg *Config) SetDefault()

func (*Config) Validate

func (cfg *Config) Validate() error

type Endpoints

type Endpoints struct {
	VQA              string `json:"vqa"                required:"true"`
	VQAHF            string `json:"vqa_hf"             required:"true"`
	Pangu            string `json:"pangu"              required:"true"`
	LuoJia           string `json:"luojia"             required:"true"`
	LuoJiaHF         string `json:"luojia_hf"          required:"true"`
	WuKong           string `json:"wukong"             required:"true"`
	WuKong4IMG       string `json:"wukong_4img"        required:"true"`
	WuKongHF         string `json:"wukong_hf"          required:"true"`
	WuKongUser       string `json:"wukong_user"        required:"true"`
	CodeGeex         string `json:"codegeex"           required:"true"`
	DescPicture      string `json:"desc_picture"       required:"true"`
	DescPictureHF    string `json:"desc_picture_hf"    required:"true"`
	SinglePicture    string `json:"single_picture"     required:"true"`
	MultiplePictures string `json:"multiple_pictures"  required:"true"`
	AIDetector       string `json:"ai_detector"        required:"true"`
	BaiChuan         string `json:"baichuan"           required:"true"`
	GLM2             string `json:"glm"                required:"true"`
	LLAMA2           string `json:"llama"              required:"true"`
	SkyWork          string `json:"skywork"            required:"true"`
	IFlytekspark     string `json:"iflytekspark"       required:"true"`
	IFlyteksparkLong string `json:"iflytekspark_long"  required:"true"`
}

type Moderation

type Moderation struct {
	Endpoint    string `json:"endpoint"       required:"true"`
	AccessKey   string `json:"access_key"     required:"true"`
	SecretKey   string `json:"secret_key"     required:"true"`
	IAMEndpoint string `json:"iam_endpoint"   required:"true"`
	Region      string `json:"region"         required:"true"`
}

type OBSAuthInfo

type OBSAuthInfo struct {
	Endpoint  string `json:"endpoint"                  required:"true"`
	AccessKey string `json:"access_key"                required:"true"`
	SecretKey string `json:"secret_key"                required:"true"`
}

type OBSConfig

type OBSConfig struct {
	OBSAuthInfo

	VQABucket    string `json:"vqa_bucket"             required:"true"`
	LuoJiaBucket string `json:"luo_jia_bucket"         required:"true"`
}

type WuKong

type WuKong struct {
	WuKongSample
	CloudConfig
	OBSAuthInfo

	Bucket string `json:"bucket"             required:"true"`

	// DownloadExpiry specifies the timeout to download a obs file.
	// The unit is second.
	DownloadExpiry int `json:"download_expiry"`
}

type WuKongSample

type WuKongSample struct {
	SampleId    string `json:"sample_id"     required:"true"`
	SampleNum   int    `json:"sample_num"    required:"true"`
	SampleCount int    `json:"sample_count"  required:"true"`
}

Jump to

Keyboard shortcuts

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