mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-04-07 14:04:30 +08:00
Fix bugs with imagen-* models
This commit is contained in:
@ -96,3 +96,6 @@
|
||||
|
||||
## 2.3.0
|
||||
* Add license.
|
||||
|
||||
## 2.3.1
|
||||
* Bug fix.
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
},
|
||||
|
||||
"guid" : "asc.{9DC93CDB-B576-4F0C-B55E-FCC9C48DD007}",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"minVersion" : "8.2.0",
|
||||
|
||||
"variations" : [
|
||||
|
||||
Binary file not shown.
@ -92,7 +92,7 @@ class Provider extends AI.Provider {
|
||||
default:
|
||||
let addon = ":generateContent";
|
||||
if (endpoint === Types.v1.Images_Generations) {
|
||||
if (-1 != model.id.indexOf("imagen-3"))
|
||||
if (-1 != model.id.indexOf("imagen-"))
|
||||
addon = ":predict";
|
||||
}
|
||||
url = "/" + model.id + addon;
|
||||
@ -134,7 +134,7 @@ class Provider extends AI.Provider {
|
||||
result.generationConfig = {"responseModalities":["TEXT","IMAGE"]};
|
||||
return result;
|
||||
}
|
||||
if (-1 != model.id.indexOf("imagen-3")) {
|
||||
if (-1 != model.id.indexOf("imagen-")) {
|
||||
return {
|
||||
instances: [
|
||||
{
|
||||
|
||||
@ -398,6 +398,12 @@
|
||||
imageUrl = "data:image/svg+xml;base64," + btoa(imageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
if (!imageUrl) {
|
||||
let candidates = getProp("predictions");
|
||||
if (candidates && candidates[0] && candidates[0].bytesBase64Encoded)
|
||||
imageUrl = candidates[0].bytesBase64Encoded;
|
||||
}
|
||||
|
||||
if (!imageUrl)
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user