ratio

package
v0.0.0-...-bddbc0c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	USD2RMB = 7
	USD     = 500 // $0.002 = 1 -> $1 = 500
	RMB     = USD / USD2RMB
)

Variables

View Source
var CompletionRatio = map[string]float64{}
View Source
var DefaultCompletionRatio map[string]float64
View Source
var DefaultModelRatio map[string]float64
View Source
var GroupRatio = map[string]float64{
	"default": 1,
	"vip":     1,
	"svip":    1,
}
View Source
var ImageGenerationAmounts = map[string][2]int{
	"dall-e-2":                  {1, 10},
	"dall-e-3":                  {1, 1},
	"ali-stable-diffusion-xl":   {1, 4},
	"ali-stable-diffusion-v1.5": {1, 4},
	"wanx-v1":                   {1, 4},
	"cogview-3":                 {1, 1},
}
View Source
var ImagePromptLengthLimitations = map[string]int{
	"dall-e-2":                  1000,
	"dall-e-3":                  4000,
	"ali-stable-diffusion-xl":   4000,
	"ali-stable-diffusion-v1.5": 4000,
	"wanx-v1":                   4000,
	"cogview-3":                 833,
}
View Source
var ImageSizeRatios = map[string]map[string]float64{
	"dall-e-2": {
		"256x256":   1,
		"512x512":   1.125,
		"1024x1024": 1.25,
	},
	"dall-e-3": {
		"1024x1024": 1,
		"1024x1792": 2,
		"1792x1024": 2,
	},
	"ali-stable-diffusion-xl": {
		"512x1024":  1,
		"1024x768":  1,
		"1024x1024": 1,
		"576x1024":  1,
		"1024x576":  1,
	},
	"ali-stable-diffusion-v1.5": {
		"512x1024":  1,
		"1024x768":  1,
		"1024x1024": 1,
		"576x1024":  1,
		"1024x576":  1,
	},
	"wanx-v1": {
		"1024x1024": 1,
		"720x1280":  1,
		"1280x720":  1,
	},
}
View Source
var ModelRatio = map[string]float64{}/* 143 elements not displayed */

ModelRatio https://platform.openai.com/docs/models/model-endpoint-compatibility https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Blfmc9dlf https://openai.com/pricing 1 === $0.002 / 1K tokens 1 === ¥0.014 / 1k tokens

Functions

func AddNewMissingRatio

func AddNewMissingRatio(oldRatio string) string

func CompletionRatio2JSONString

func CompletionRatio2JSONString() string

func GetCompletionRatio

func GetCompletionRatio(name string) float64

func GetGroupRatio

func GetGroupRatio(name string) float64

func GetModelRatio

func GetModelRatio(name string) float64

func GroupRatio2JSONString

func GroupRatio2JSONString() string

func ModelRatio2JSONString

func ModelRatio2JSONString() string

func UpdateCompletionRatioByJSONString

func UpdateCompletionRatioByJSONString(jsonStr string) error

func UpdateGroupRatioByJSONString

func UpdateGroupRatioByJSONString(jsonStr string) error

func UpdateModelRatioByJSONString

func UpdateModelRatioByJSONString(jsonStr string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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