push
This commit is contained in:
Binary file not shown.
Binary file not shown.
+1
-1
@@ -84,7 +84,7 @@ class LLM_Loader:
|
||||
"DeepSeek/深度求索": "https://api.deepseek.com/v1",
|
||||
"DouBao/豆包": "https://ark.cn-beijing.volces.com/api/v3",
|
||||
"Spark/星火": "https://spark-api-open.xf-yun.com/v1",
|
||||
"GLM/智谱清言": "https://open.bigmodel.cn/api/paas/v4",
|
||||
"GLM/智谱清言": "https://open.bigmodel.cn/api/paas/v4/",
|
||||
"Moonshot/月之暗面": "https://api.moonshot.cn/v1",
|
||||
"Baichuan/百川": "https://api.baichuan-ai.com/v1",
|
||||
"MiniMax/MiniMax": "https://api.minimax.chat/v1",
|
||||
|
||||
@@ -6,6 +6,7 @@ import json
|
||||
import asyncio
|
||||
from aiohttp import ClientSession, ClientError
|
||||
from typing import Optional, List, Dict
|
||||
import time # 添加时间模块
|
||||
|
||||
|
||||
class OpenAICompatibleLoader:
|
||||
@@ -103,6 +104,8 @@ class OpenAICompatibleLoader:
|
||||
print(f"[DEBUG] Generated Payload: {json.dumps(payload, indent=2)}") # 调试日志
|
||||
|
||||
try:
|
||||
# 添加延迟以避免触发速率限制
|
||||
time.sleep(1) # 每次请求前等待 1 秒
|
||||
return asyncio.run(self.async_generate(payload, actual_base_url, api_key))
|
||||
except Exception as e:
|
||||
raise Exception(f"请求失败: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user