Skip to content

Commit

Permalink
feat: sync ChatGLM options in frontend and backend (casibase#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisRoad authored Mar 4, 2024
1 parent d2d424b commit 7f0b840
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions model/chatglm.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Generate Model:
func (p *ChatGLMModelProvider) calculatePrice(modelResult *ModelResult) error {
price := 0.0
switch p.subType {
case "GLM-3-Turbo":
case "glm-3-turbo":
price = getPrice(modelResult.TotalTokenCount, 0.005)
case "GLM-4", "GLM-4V":
case "glm-4", "glm-4v":
price = getPrice(modelResult.TotalTokenCount, 0.1)
default:
return fmt.Errorf("calculatePrice() error: unknown model type: %s", p.subType)
Expand Down
4 changes: 3 additions & 1 deletion web/src/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,9 @@ export function getProviderSubTypeOptions(category, type) {
} else if (type === "ChatGLM") {
return (
[
{id: "chatglm2-6b", name: "chatglm2-6b"},
{id: "glm-3-turbo", name: "glm-3-turbo"},
{id: "glm-4", name: "glm-4"},
{id: "glm-4V", name: "glm-4V"},
]
);
} else if (type === "MiniMax") {
Expand Down

0 comments on commit 7f0b840

Please sign in to comment.