From 0269180e7881c2c8fcba2d0a0e2cdff24d769643 Mon Sep 17 00:00:00 2001 From: xiaozhou26 Date: Mon, 10 Jun 2024 22:01:49 +0800 Subject: [PATCH] Update duckgo convert.go to support Llama-3-70b and Mixtral-8x7B models --- .github/workflows/build.yml | 2 +- README.md | 3 ++- conversion/requests/duckgo/convert.go | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09b54f4..b20a999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GHCR_PAT }} with: - tag_name: v2.0.9 + tag_name: v2.1.0 files: | duck2api-linux-amd64.tar.gz duck2api-windows-amd64.tar.gz diff --git a/README.md b/README.md index e0990e7..d296477 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ curl --location 'http://你的服务器ip:8080/v1/chat/completions' \ "stream": true }' ``` -支持claude和gpt-3.5-turbo +## 支持的模型 +claude和gpt-3.5-turbo,Llama-3-70b,Mixtral-8x7B等模型 ## 高级设置 默认情况不需要设置,除非你有需求 diff --git a/conversion/requests/duckgo/convert.go b/conversion/requests/duckgo/convert.go index 65768fa..1719cac 100644 --- a/conversion/requests/duckgo/convert.go +++ b/conversion/requests/duckgo/convert.go @@ -13,6 +13,14 @@ func ConvertAPIRequest(api_request officialtypes.APIRequest) duckgotypes.ApiRequ if strings.HasPrefix(strings.ToLower(api_request.Model), "claude") { duckgo_request.Model = "claude-3-haiku-20240307" } + if strings.HasPrefix(strings.ToLower(api_request.Model), "Llama-3-70b") { + + duckgo_request.Model = "meta-llama/Llama-3-70b-chat-hf" + } + if strings.HasPrefix(strings.ToLower(api_request.Model), "Mixtral-8x7B") { + + duckgo_request.Model = "mistralai/Mixtral-8x7B-Instruct-v0.1" + } content := buildContent(&api_request) duckgo_request.AddMessage("user", content) return duckgo_request