sanbo
commited on
Commit
·
c2c113a
1
Parent(s):
dec0734
update sth. at 2025-02-19 18:59:32
Browse files- README.md +48 -5
- conversion/requests/duckgo/convert.go +2 -6
- initialize/handlers.go +2 -2
- web/index.html +1 -1
README.md
CHANGED
|
@@ -1,11 +1,54 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Duck2api
|
| 3 |
+
emoji: 🏆
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
short_description: duck 2 api service
|
| 10 |
+
thumbnail: >-
|
| 11 |
+
https://cdn-uploads.huggingface.co/production/uploads/6642196ec80d018c28a68e9a/PHwTcv57ZhgW7--5-HTRn.png
|
| 12 |
---
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# dai
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
## huggingface访问
|
| 21 |
+
|
| 22 |
+
``` bash
|
| 23 |
+
curl --location 'https://NiansuhAI-dapi.hf.space/completions' \
|
| 24 |
+
--header 'Content-Type: application/json' \
|
| 25 |
+
--data '{
|
| 26 |
+
"model": "gpt-4o-mini",
|
| 27 |
+
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}],
|
| 28 |
+
"stream": true
|
| 29 |
+
}'
|
| 30 |
+
|
| 31 |
+
curl --location 'https://NiansuhAI-dapi.hf.space/api/v1/chat/completions' \
|
| 32 |
+
--header 'Content-Type: application/json' \
|
| 33 |
+
--data '{
|
| 34 |
+
"model": "gpt-4o-mini",
|
| 35 |
+
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}],
|
| 36 |
+
"stream": true
|
| 37 |
+
}'
|
| 38 |
+
|
| 39 |
+
curl --location 'https://NiansuhAI-dapi.hf.space/hf/v1/chat/completions' \
|
| 40 |
+
--header 'Content-Type: application/json' \
|
| 41 |
+
--data '{
|
| 42 |
+
"model": "gpt-4o-mini",
|
| 43 |
+
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}],
|
| 44 |
+
"stream": true
|
| 45 |
+
}'
|
| 46 |
+
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## 支持的模型
|
| 50 |
+
|
| 51 |
+
- claude-3-haiku
|
| 52 |
+
- llama-3.3-70b
|
| 53 |
+
- mixtral-8x7b
|
| 54 |
+
- gpt-4o-mini
|
conversion/requests/duckgo/convert.go
CHANGED
|
@@ -14,16 +14,12 @@ func ConvertAPIRequest(api_request officialtypes.APIRequest) duckgotypes.ApiRequ
|
|
| 14 |
// 如果模型未进行映射,则直接使用输入模型,方便后续用户使用 duckduckgo 添加的新模型。
|
| 15 |
modelLower := strings.ToLower(inputModel)
|
| 16 |
switch {
|
| 17 |
-
case strings.HasPrefix(modelLower, "gpt-4o-mini"):
|
| 18 |
-
realModel = "gpt-4o-mini"
|
| 19 |
-
case strings.HasPrefix(modelLower, "gpt-4o"):
|
| 20 |
-
realModel = "gpt-4o-mini"
|
| 21 |
case strings.HasPrefix(modelLower, "gpt-3.5"):
|
| 22 |
realModel = "gpt-4o-mini"
|
| 23 |
case strings.HasPrefix(modelLower, "claude-3-haiku"):
|
| 24 |
realModel = "claude-3-haiku-20240307"
|
| 25 |
-
case strings.HasPrefix(modelLower, "llama-3.
|
| 26 |
-
realModel = "meta-llama/
|
| 27 |
case strings.HasPrefix(modelLower, "mixtral-8x7b"):
|
| 28 |
realModel = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 29 |
case strings.HasPrefix(modelLower, "o3-mini"):
|
|
|
|
| 14 |
// 如果模型未进行映射,则直接使用输入模型,方便后续用户使用 duckduckgo 添加的新模型。
|
| 15 |
modelLower := strings.ToLower(inputModel)
|
| 16 |
switch {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
case strings.HasPrefix(modelLower, "gpt-3.5"):
|
| 18 |
realModel = "gpt-4o-mini"
|
| 19 |
case strings.HasPrefix(modelLower, "claude-3-haiku"):
|
| 20 |
realModel = "claude-3-haiku-20240307"
|
| 21 |
+
case strings.HasPrefix(modelLower, "llama-3.3-70b"):
|
| 22 |
+
realModel = "meta-llama/Llama-3.3-70B-Instruct-Turbo"
|
| 23 |
case strings.HasPrefix(modelLower, "mixtral-8x7b"):
|
| 24 |
realModel = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 25 |
case strings.HasPrefix(modelLower, "o3-mini"):
|
initialize/handlers.go
CHANGED
|
@@ -95,10 +95,10 @@ func (h *Handler) engines(c *gin.Context) {
|
|
| 95 |
|
| 96 |
// Supported models
|
| 97 |
modelIDs := []string{
|
| 98 |
-
"o3-mini",
|
| 99 |
"gpt-4o-mini",
|
|
|
|
| 100 |
"claude-3-haiku-20240307",
|
| 101 |
-
"meta-llama/Llama-3-
|
| 102 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 103 |
}
|
| 104 |
|
|
|
|
| 95 |
|
| 96 |
// Supported models
|
| 97 |
modelIDs := []string{
|
|
|
|
| 98 |
"gpt-4o-mini",
|
| 99 |
+
"o3-mini",
|
| 100 |
"claude-3-haiku-20240307",
|
| 101 |
+
"meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
| 102 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 103 |
}
|
| 104 |
|
web/index.html
CHANGED
|
@@ -2479,7 +2479,7 @@
|
|
| 2479 |
<option value="o3-mini">o3-mini</option>
|
| 2480 |
<option value="gpt-4o-mini">gpt-4o-mini</option>
|
| 2481 |
<option value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
|
| 2482 |
-
<option value="llama-3.
|
| 2483 |
<option value="mixtral-8x7b">mixtral-8x7b</option>
|
| 2484 |
</select>
|
| 2485 |
</div>
|
|
|
|
| 2479 |
<option value="o3-mini">o3-mini</option>
|
| 2480 |
<option value="gpt-4o-mini">gpt-4o-mini</option>
|
| 2481 |
<option value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
|
| 2482 |
+
<option value="llama-3.3-70b">llama-3.3-70b</option>
|
| 2483 |
<option value="mixtral-8x7b">mixtral-8x7b</option>
|
| 2484 |
</select>
|
| 2485 |
</div>
|