-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DALL·E 3, DALL·E 3 HD, DALL·E 2 支持、减少模型混淆以及更好的处理图像中继的代码逻辑 #679
DALL·E 3, DALL·E 3 HD, DALL·E 2 支持、减少模型混淆以及更好的处理图像中继的代码逻辑 #679
Conversation
added new Dall-E models and size ratios
改动较多,近期处理哈 |
relayImageHelper function
controller/relay-image.go
Outdated
if imageRequest.Prompt == "" { | ||
return errorWrapper(errors.New("prompt is required"), "required_field_missing", http.StatusBadRequest) | ||
// Model validation | ||
if imageRequest.Model != "" && imageRequest.Model != "dall-e-3" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lack of assigning the model name parsed from UnmarshalBodyReusable
to imageModel
here causes it to always be dall-e-2
later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I think return a invalid_field_value
error when imageRequest.Model
is neither dall-e-2
nor dall-e-3
, will be better than assign default dall-e-2
here
middleware/distributor.go line63, need to change default model from "dall-e" to "dall-e-2"
|
Thank you for reviewing my code, I am so sorry for not publishing my updated code before I go for exam, hopefully those issues will be fixed in 2 days. |
DalleSizeRatios map
relayImageHelper function
and defined image generation ratios
DalleGenerationImageAmountRatios to DalleGenerationImageAmounts
relayImageHelper function
supported error in relayImageHelper function
relayImageHelper function
@ckt1031 Hello, I plan to review and merge this PR coming Friday. Will there be any additional commits? |
There will not be any additional commits |
Thx~ |
…ync-one-api * 'main' of https://github.com/songquanpeng/one-api: fix: cloudflare test & expose detailed info about test failures (songquanpeng#715) feat: support tts model (songquanpeng#713) feat: keep sync with dall-e updates (songquanpeng#679) fix: fix PaLM not working issue (songquanpeng#667) fix: fix channel_id column name (songquanpeng#681, close songquanpeng#688) feat: add improve docker-compose.yml and support fast startup (songquanpeng#685) docs: add deploy to zeabur button (songquanpeng#693) fix: numeric sorting in tables (songquanpeng#695) feat: sync pricing for new 1106 models (songquanpeng#696) docs: update readme chore: update quota calc logic (close songquanpeng#599) (songquanpeng#627) fix: fix Cloudflare AI Gateway channel test support (songquanpeng#639) feat: support chatglm_turbo (songquanpeng#648) fix: fix typo (songquanpeng#651)
* Updated ImageRequest struct and OpenAIModels, added new Dall-E models and size ratios * Fixed suspect `or` * Refactored size ratio calculation in relayImageHelper function * Updated the format of resolution keys in DalleSizeRatios map * Added error handling for unsupported image size in relayImageHelper function * Added validation for number of generated images and defined image generation ratios * Refactored variable name from DalleGenerationImageAmountRatios to DalleGenerationImageAmounts * Added validation for prompt length in relayImageHelper function * Updated model validation and removed size not supported error in relayImageHelper function * Refactored image size and model validation in relayImageHelper function * chore: discard binary file * chore: update impl --------- Co-authored-by: cktsun1031 <65409152+cktsun1031@users.noreply.github.com> Co-authored-by: JustSong <songquanpeng@foxmail.com>
No description provided.