From dec19d68b3519208bf8aa032017ecbfb0cfa6c71 Mon Sep 17 00:00:00 2001 From: SPWwj Date: Sat, 13 May 2023 15:46:37 +0800 Subject: [PATCH] Fix missing Locale image properties --- app/components/image-model-config.tsx | 6 +-- app/components/markdown.tsx | 2 +- app/locales/cn.ts | 2 +- app/locales/cs.ts | 2 +- app/locales/de.ts | 2 +- app/locales/en.ts | 2 +- app/locales/es.ts | 2 +- app/locales/it.ts | 2 +- app/locales/jp.ts | 2 +- app/locales/ru.ts | 2 +- app/locales/tr.ts | 2 +- app/locales/tw.ts | 2 +- app/locales/vi.ts | 2 +- app/masks/cn.ts | 55 +++++++++++++++++++++++++++ app/masks/en.ts | 5 +++ app/requests.ts | 2 +- app/store/config.ts | 2 +- 17 files changed, 77 insertions(+), 17 deletions(-) diff --git a/app/components/image-model-config.tsx b/app/components/image-model-config.tsx index aea8f80cdb9..b87d7bacc3e 100644 --- a/app/components/image-model-config.tsx +++ b/app/components/image-model-config.tsx @@ -32,14 +32,14 @@ export function ImageModelConfigList(props: { }} /> - + { const newValue = parseInt(e.currentTarget.value, 10); // Parse the value as an integer if (!isNaN(newValue)) { props.updateConfig((config) => { - config.imageLimit = newValue; // Assign the parsed value + config.noOfImage = newValue; // Assign the parsed value return config; }); } diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 74f7f64dcb6..7be568f3e1c 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -17,7 +17,7 @@ import ImagePlaceHolder from "../icons/image-placeholder.svg"; import ImageError from "../icons/image-error.svg"; import { IMAGE_PLACEHOLDER } from "../constant"; import { ImagesResponseDataInner } from "openai"; -import ImageList from "./ImageList"; +import ImageList from "./imageList"; export function Mermaid(props: { code: string; onError: () => void }) { const ref = useRef(null); diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 7403f1cdd2f..fade044fd42 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -159,7 +159,7 @@ const cn = { Title: "图片模型", Model: "DALL-E模型", Command: "生成图片指令", - CountLimit: "图片生成次数限制", + NoOfImage: "图片生成次数限制", Size: "图片生成尺寸", }, Temperature: { diff --git a/app/locales/cs.ts b/app/locales/cs.ts index 47909dffedb..6162849f0d5 100644 --- a/app/locales/cs.ts +++ b/app/locales/cs.ts @@ -160,7 +160,7 @@ const cs: LocaleType = { Title: "Obrázkový model", Model: "Model DALL-E", Command: "Příkaz pro generování obrázků", - CountLimit: "Limit počtu generovaných obrázků", + NoOfImage: "Limit počtu generovaných obrázků", Size: "Velikost generovaného obrázku", }, Temperature: { diff --git a/app/locales/de.ts b/app/locales/de.ts index 8024ebd76eb..d3791e54edb 100644 --- a/app/locales/de.ts +++ b/app/locales/de.ts @@ -162,7 +162,7 @@ const de: LocaleType = { Title: "Bildmodell", Model: "DALL-E Modell", Command: "Bildgenerierungsbefehl", - CountLimit: "Bildgenerierungslimit", + NoOfImage: "Bildgenerierungslimit", Size: "Bildgenerierungsgröße", }, Temperature: { diff --git a/app/locales/en.ts b/app/locales/en.ts index 04ba5a4c348..7dd867616cb 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -160,7 +160,7 @@ const en: LocaleType = { Title: "Image Model", Model: "DALL-E Model", Command: "Generate Image Command", - CountLimit: "Image Generation Limit", + NoOfImage: "Image Generation Limit", Size: "Image Generation Size", }, Temperature: { diff --git a/app/locales/es.ts b/app/locales/es.ts index f7bf5f4c6a2..382cce7430b 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -160,7 +160,7 @@ const es: LocaleType = { Title: "Modelo de imagen", Model: "Modelo DALL-E", Command: "Comando de generación de imágenes", - CountLimit: "Límite de generación de imágenes", + NoOfImage: "Límite de generación de imágenes", Size: "Tamaño de generación de imagen", }, Temperature: { diff --git a/app/locales/it.ts b/app/locales/it.ts index 6c2c4c2f534..7616b7259e4 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -161,7 +161,7 @@ const it: LocaleType = { Title: "Modello di immagine", Model: "Modello DALL-E", Command: "Comando di generazione immagine", - CountLimit: "Limite di generazione immagine", + NoOfImage: "Limite di generazione immagine", Size: "Dimensione di generazione immagine", }, Temperature: { diff --git a/app/locales/jp.ts b/app/locales/jp.ts index ef8a0049e1e..9c317b152c5 100644 --- a/app/locales/jp.ts +++ b/app/locales/jp.ts @@ -162,7 +162,7 @@ const jp: LocaleType = { Title: "画像モデル", Model: "DALL-Eモデル", Command: "画像生成コマンド", - CountLimit: "画像生成回数制限", + NoOfImage: "画像生成回数制限", Size: "画像生成サイズ", }, Temperature: { diff --git a/app/locales/ru.ts b/app/locales/ru.ts index 50dde81420a..f99d64c2952 100644 --- a/app/locales/ru.ts +++ b/app/locales/ru.ts @@ -161,7 +161,7 @@ const ru: LocaleType = { Title: "Модель изображения", Model: "Модель DALL-E", Command: "Команда генерации изображений", - CountLimit: "Лимит генерации изображений", + NoOfImage: "Лимит генерации изображений", Size: "Размер генерируемого изображения", }, Temperature: { diff --git a/app/locales/tr.ts b/app/locales/tr.ts index 83207086e3e..ed415e5b4c1 100644 --- a/app/locales/tr.ts +++ b/app/locales/tr.ts @@ -160,7 +160,7 @@ const tr: LocaleType = { Title: "Resim Modeli", Model: "DALL-E Modeli", Command: "Resim Oluşturma Komutu", - CountLimit: "Resim Oluşturma Limiti", + NoOfImage: "Resim Oluşturma Limiti", Size: "Resim Oluşturma Boyutu", }, Temperature: { diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 4534c135aa2..e14fbc0819d 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -157,7 +157,7 @@ const tw: LocaleType = { Title: "圖片模型", Model: "DALL-E模型", Command: "生成圖片指令", - CountLimit: "圖片生成次數限制", + NoOfImage: "圖片生成次數限制", Size: "圖片生成尺寸", }, Temperature: { diff --git a/app/locales/vi.ts b/app/locales/vi.ts index d16cfb4d1b9..7a966d792ec 100644 --- a/app/locales/vi.ts +++ b/app/locales/vi.ts @@ -159,7 +159,7 @@ const vi: LocaleType = { Title: "Mô hình hình ảnh", Model: "Mô hình DALL-E", Command: "Lệnh tạo hình ảnh", - CountLimit: "Giới hạn số lượng hình ảnh tạo ra", + NoOfImage: "Giới hạn số lượng hình ảnh tạo ra", Size: "Kích thước hình ảnh được tạo ra", }, Temperature: { diff --git a/app/masks/cn.ts b/app/masks/cn.ts index 757a35ee978..52ab6657c00 100644 --- a/app/masks/cn.ts +++ b/app/masks/cn.ts @@ -21,6 +21,11 @@ export const CN_MASKS: BuiltinMask[] = [ historyMessageCount: 4, compressMessageLengthThreshold: 1000, }, + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, lang: "cn", builtin: true, }, @@ -44,6 +49,11 @@ export const CN_MASKS: BuiltinMask[] = [ historyMessageCount: 4, compressMessageLengthThreshold: 1000, }, + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, lang: "cn", builtin: true, }, @@ -67,6 +77,11 @@ export const CN_MASKS: BuiltinMask[] = [ historyMessageCount: 4, compressMessageLengthThreshold: 1000, }, + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, lang: "cn", builtin: true, }, @@ -81,6 +96,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -104,6 +124,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -127,6 +152,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -150,6 +180,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -173,6 +208,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -202,6 +242,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -231,6 +276,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, @@ -281,6 +331,11 @@ export const CN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-3.5-turbo", temperature: 1, diff --git a/app/masks/en.ts b/app/masks/en.ts index af4f215c456..78d0b5c0fc9 100644 --- a/app/masks/en.ts +++ b/app/masks/en.ts @@ -29,6 +29,11 @@ export const EN_MASKS: BuiltinMask[] = [ date: "", }, ], + imageModelConfig: { + command: "/image", + noOfImage: 1, + size: "256x256", + }, modelConfig: { model: "gpt-4", temperature: 0.5, diff --git a/app/requests.ts b/app/requests.ts index 75b4d4c3a17..3a6943515fe 100644 --- a/app/requests.ts +++ b/app/requests.ts @@ -156,7 +156,7 @@ const makeImageRequestParam = ( ): CreateImageRequest => { // Set default values const defaultOptions: Omit = { - n: useAppConfig.getState().imageModelConfig.imageLimit, + n: useAppConfig.getState().imageModelConfig.noOfImage, response_format: CreateImageRequestResponseFormatEnum.Url, user: "default_user", }; diff --git a/app/store/config.ts b/app/store/config.ts index 4807a470de3..9c05ce1b7ab 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -41,7 +41,7 @@ export const DEFAULT_CONFIG = { compressMessageLengthThreshold: 1000, }, imageModelConfig: { - imageLimit: 1, + noOfImage: 1, command: COMMAND_IMAGE, size: "256x256" as ImageRequestSizeEnum, },