Skip to content
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

update custom bytedance models, and update labels in setting page #4989

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,7 @@ export function Settings() {
<ListItem
title={Locale.Settings.Access.Baidu.Endpoint.Title}
subTitle={
Locale.Settings.Access.Anthropic.Endpoint.SubTitle +
Baidu.ExampleEndpoint
Locale.Settings.Access.Baidu.Endpoint.SubTitle
}
>
<input
Expand Down
2 changes: 1 addition & 1 deletion app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const cn = {
},
Endpoint: {
Title: "接口地址",
SubTitle: "样例:",
SubTitle: "不支持自定义前往.env配置",
},
},
ByteDance: {
Expand Down
10 changes: 5 additions & 5 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ const en: LocaleType = {

Endpoint: {
Title: "Endpoint Address",
SubTitle: "Example:",
SubTitle: "Example: ",
},

ApiVerion: {
Expand All @@ -347,7 +347,7 @@ const en: LocaleType = {
},
Endpoint: {
Title: "Endpoint Address",
SubTitle: "Example:",
SubTitle: "not supported, configure in .env",
},
},
ByteDance: {
Expand All @@ -358,7 +358,7 @@ const en: LocaleType = {
},
Endpoint: {
Title: "Endpoint Address",
SubTitle: "Example:",
SubTitle: "Example: ",
},
},
Alibaba: {
Expand All @@ -369,7 +369,7 @@ const en: LocaleType = {
},
Endpoint: {
Title: "Endpoint Address",
SubTitle: "Example:",
SubTitle: "Example: ",
},
},
CustomModel: {
Expand All @@ -385,7 +385,7 @@ const en: LocaleType = {

Endpoint: {
Title: "Endpoint Address",
SubTitle: "Example:",
SubTitle: "Example: ",
},

ApiVersion: {
Expand Down
6 changes: 5 additions & 1 deletion app/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ export function collectModelTable(
}
// 2. if model not exists, create new model with available value
if (count === 0) {
const [customModelName, customProviderName] = name.split("@");
let [customModelName, customProviderName] = name.split("@");
const provider = customProvider(
customProviderName || customModelName,
);
// swap name and displayName for bytedance
if (displayName && provider.providerName == "ByteDance") {
[customModelName, displayName] = [displayName, customModelName];
}
modelTable[`${customModelName}@${provider?.id}`] = {
name: customModelName,
displayName: displayName || customModelName,
Expand Down
Loading