Skip to content

Commit

Permalink
remove 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 committed Aug 6, 2024
1 parent d9775d2 commit 914f8ea
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
with:
tag_name: v2.1.1
tag_name: v2.1.2
files: |
duck2api-linux-amd64.tar.gz
duck2api-windows-amd64.tar.gz
Expand Down
3 changes: 1 addition & 2 deletions conversion/requests/duckgo/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ func ConvertAPIRequest(api_request officialtypes.APIRequest) duckgotypes.ApiRequ
duckgo_request := duckgotypes.NewApiRequest(inputModel)
realModel := inputModel

// 模型映射,简化用户输入模型,例如 gpt-3.5 --> gpt-3.5-turbo-0125
// 如果模型未进行映射,则直接使用输入模型,方便后续用户使用 duckduckgo 添加的新模型。
modelLower := strings.ToLower(inputModel)
switch {
case strings.HasPrefix(modelLower, "gpt-3.5"):
realModel = "gpt-3.5-turbo-0125"
realModel = "gpt-4o-mini"
case strings.HasPrefix(modelLower, "claude-3-haiku"):
realModel = "claude-3-haiku-20240307"
case strings.HasPrefix(modelLower, "llama-3-70b"):
Expand Down
1 change: 1 addition & 0 deletions initialize/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (h *Handler) engines(c *gin.Context) {

// Supported models
modelIDs := []string{
"gpt-4o-mini",
"gpt-3.5-turbo-0125",
"claude-3-haiku-20240307",
"meta-llama/Llama-3-70b-chat-hf",
Expand Down
6 changes: 3 additions & 3 deletions typings/official/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewChatCompletionChunk(text string) ChatCompletionChunk {
ID: "chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK",
Object: "chat.completion.chunk",
Created: 0,
Model: "gpt-3.5-turbo-0301",
Model: "gpt-4o-mini",
Choices: []Choices{
{
Index: 0,
Expand Down Expand Up @@ -82,7 +82,7 @@ func StopChunk(reason string) ChatCompletionChunk {
ID: "chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK",
Object: "chat.completion.chunk",
Created: 0,
Model: "gpt-3.5-turbo-0125",
Model: "gpt-4o-mini",
Choices: []Choices{
{
Index: 0,
Expand Down Expand Up @@ -143,7 +143,7 @@ func NewChatCompletion(full_test string, input_tokens, output_tokens int) ChatCo
ID: "chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK",
Object: "chat.completion",
Created: int64(0),
Model: "gpt-3.5-turbo-0125",
Model: "gpt-4o-mini",
Usage: usage{
PromptTokens: input_tokens,
CompletionTokens: output_tokens,
Expand Down
5 changes: 3 additions & 2 deletions util/util.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package util

import (
"github.com/pkoukk/tiktoken-go"
"log/slog"
"math/rand"
"time"

"github.com/pkoukk/tiktoken-go"
)

func RandomLanguage() string {
Expand All @@ -28,7 +29,7 @@ func RandomHexadecimalString() string {
return string(b)
}
func CountToken(input string) int {
encoding := "gpt-3.5-turbo"
encoding := "gpt-4o-mini"
tkm, err := tiktoken.EncodingForModel(encoding)
if err != nil {
slog.Warn("tiktoken.EncodingForModel error:", err)
Expand Down
3 changes: 1 addition & 2 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,6 @@
<div class="presetSelect presetModelCls">
<label for="preSetModel" data-i18n-key="gptModel"></label>
<select id="preSetModel">
<option value="gpt-3.5-turbo-0125">gpt-3.5-turbo-0125</option>
<option value="gpt-4o-mini">gpt-4o-mini</option>
<option value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
<option value="llama-3-70b">llama-3-70b</option>
Expand Down Expand Up @@ -5716,7 +5715,7 @@
const initSetting = () => {
const modelEle = document.getElementById("preSetModel");
let localModel = localStorage.getItem("modelVersion");
modelVersion = modelEle.value = localModel || "gpt-3.5-turbo";
modelVersion = modelEle.value = localModel || "gpt-4o-mini";
modelEle.onchange = () => {
modelVersion = modelEle.value;
localStorage.setItem("modelVersion", modelVersion);
Expand Down

0 comments on commit 914f8ea

Please sign in to comment.