Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
examples/open_deep_research/api_test.py
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
|
| 2 |
from gradio_client import Client
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# 在文件顶部添加
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
# 修改Client
|
| 8 |
-
client = Client("
|
| 9 |
|
| 10 |
# First log the user message
|
| 11 |
log_result = client.predict(
|
|
|
|
| 1 |
|
| 2 |
from gradio_client import Client
|
| 3 |
+
import sys
|
| 4 |
+
import os
|
| 5 |
+
from dotenv import load_dotenv
|
| 6 |
|
| 7 |
# 在文件顶部添加
|
| 8 |
+
load_dotenv() # 加载环境变量
|
| 9 |
+
|
| 10 |
+
# 获取 Hugging Face 令牌
|
| 11 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 12 |
+
if not hf_token:
|
| 13 |
+
print("错误:未找到 HF_TOKEN 环境变量。请设置您的 Hugging Face 令牌。")
|
| 14 |
+
sys.exit(1)
|
| 15 |
|
| 16 |
+
# 修改Client初始化,添加认证令牌
|
| 17 |
+
client = Client("MaoShen/Moonshot_DeepResearch", hf_token=hf_token)
|
| 18 |
|
| 19 |
# First log the user message
|
| 20 |
log_result = client.predict(
|
examples/open_deep_research/d007.Projects008.deep_researchsmolagents2.env
ADDED
|
File without changes
|
requirements.txt
CHANGED
|
@@ -38,5 +38,12 @@ python-pptx
|
|
| 38 |
torch
|
| 39 |
xlrd
|
| 40 |
SpeechRecognition
|
| 41 |
-
#
|
| 42 |
-
smolagents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
torch
|
| 39 |
xlrd
|
| 40 |
SpeechRecognition
|
| 41 |
+
# 添加以下行来安装当前目录的包及其扩展
|
| 42 |
+
smolagents[litellm]
|
| 43 |
+
# 添加从文件中发现的其他依赖
|
| 44 |
+
gradio-client
|
| 45 |
+
gradio
|
| 46 |
+
bs4
|
| 47 |
+
fractions
|
| 48 |
+
argparse
|
| 49 |
+
threading
|