Skip to content

Commit

Permalink
Fix missing Locale image properties
Browse files Browse the repository at this point in the history
  • Loading branch information
SPWwj committed May 13, 2023
1 parent e2be9ae commit dec19d6
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 17 deletions.
6 changes: 3 additions & 3 deletions app/components/image-model-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export function ImageModelConfigList(props: {
}}
/>
</ListItem>
<ListItem title={Locale.Settings.ImageModel.CountLimit}>
<ListItem title={Locale.Settings.ImageModel.NoOfImage}>
<InputRange
value={props.imageModelConfig.imageLimit.toString()} // Keep the value as a string
value={props.imageModelConfig.noOfImage.toString()} // Keep the value as a string
onChange={(e) => {
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;
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>(null);

Expand Down
2 changes: 1 addition & 1 deletion app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const cn = {
Title: "图片模型",
Model: "DALL-E模型",
Command: "生成图片指令",
CountLimit: "图片生成次数限制",
NoOfImage: "图片生成次数限制",
Size: "图片生成尺寸",
},
Temperature: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const de: LocaleType = {
Title: "Bildmodell",
Model: "DALL-E Modell",
Command: "Bildgenerierungsbefehl",
CountLimit: "Bildgenerierungslimit",
NoOfImage: "Bildgenerierungslimit",
Size: "Bildgenerierungsgröße",
},
Temperature: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/jp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const jp: LocaleType = {
Title: "画像モデル",
Model: "DALL-Eモデル",
Command: "画像生成コマンド",
CountLimit: "画像生成回数制限",
NoOfImage: "画像生成回数制限",
Size: "画像生成サイズ",
},
Temperature: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const ru: LocaleType = {
Title: "Модель изображения",
Model: "Модель DALL-E",
Command: "Команда генерации изображений",
CountLimit: "Лимит генерации изображений",
NoOfImage: "Лимит генерации изображений",
Size: "Размер генерируемого изображения",
},
Temperature: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const tw: LocaleType = {
Title: "圖片模型",
Model: "DALL-E模型",
Command: "生成圖片指令",
CountLimit: "圖片生成次數限制",
NoOfImage: "圖片生成次數限制",
Size: "圖片生成尺寸",
},
Temperature: {
Expand Down
2 changes: 1 addition & 1 deletion app/locales/vi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
55 changes: 55 additions & 0 deletions app/masks/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export const CN_MASKS: BuiltinMask[] = [
historyMessageCount: 4,
compressMessageLengthThreshold: 1000,
},
imageModelConfig: {
command: "/image",
noOfImage: 1,
size: "256x256",
},
lang: "cn",
builtin: true,
},
Expand All @@ -44,6 +49,11 @@ export const CN_MASKS: BuiltinMask[] = [
historyMessageCount: 4,
compressMessageLengthThreshold: 1000,
},
imageModelConfig: {
command: "/image",
noOfImage: 1,
size: "256x256",
},
lang: "cn",
builtin: true,
},
Expand All @@ -67,6 +77,11 @@ export const CN_MASKS: BuiltinMask[] = [
historyMessageCount: 4,
compressMessageLengthThreshold: 1000,
},
imageModelConfig: {
command: "/image",
noOfImage: 1,
size: "256x256",
},
lang: "cn",
builtin: true,
},
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions app/masks/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export const EN_MASKS: BuiltinMask[] = [
date: "",
},
],
imageModelConfig: {
command: "/image",
noOfImage: 1,
size: "256x256",
},
modelConfig: {
model: "gpt-4",
temperature: 0.5,
Expand Down
2 changes: 1 addition & 1 deletion app/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const makeImageRequestParam = (
): CreateImageRequest => {
// Set default values
const defaultOptions: Omit<CreateImageRequest, "prompt"> = {
n: useAppConfig.getState().imageModelConfig.imageLimit,
n: useAppConfig.getState().imageModelConfig.noOfImage,
response_format: CreateImageRequestResponseFormatEnum.Url,
user: "default_user",
};
Expand Down
2 changes: 1 addition & 1 deletion app/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const DEFAULT_CONFIG = {
compressMessageLengthThreshold: 1000,
},
imageModelConfig: {
imageLimit: 1,
noOfImage: 1,
command: COMMAND_IMAGE,
size: "256x256" as ImageRequestSizeEnum,
},
Expand Down

0 comments on commit dec19d6

Please sign in to comment.