Spaces:
Build error
Build error
Init StarrySpace
Browse files- app.py +3 -3
- requirements.txt +2 -58
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
| 4 |
import time
|
| 5 |
|
| 6 |
# --- 配置 ---
|
| 7 |
-
ARK_API_KEY = os.environ.get("ARK_API_KEY")
|
| 8 |
if not ARK_API_KEY:
|
| 9 |
raise ValueError("ARK_API_KEY not found. Please set it in Space Secrets.")
|
| 10 |
|
|
@@ -156,7 +156,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
| 156 |
|
| 157 |
chatbot_component = gr.Chatbot(
|
| 158 |
label="聊天窗口",
|
| 159 |
-
type='messages', # 确保使用 'messages' 类型,以便更好地处理头像和角色
|
| 160 |
avatar_images=("images/user_avatar.png", "images/bot_avatar.png"),
|
| 161 |
height=500,
|
| 162 |
show_label=False # 隐藏 Chatbot 自己的标签,因为上面已经有标题了
|
|
@@ -169,7 +169,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
| 169 |
examples=[
|
| 170 |
["你好呀!"],
|
| 171 |
["给我讲个关于太空的笑话。"],
|
| 172 |
-
["用Python写一个快速排序算法。"]
|
| 173 |
],
|
| 174 |
submit_btn="➤ 发送",
|
| 175 |
)
|
|
|
|
| 4 |
import time
|
| 5 |
|
| 6 |
# --- 配置 ---
|
| 7 |
+
ARK_API_KEY = os.environ.get("ARK_API_KEY","490bb669-7a60-4b0d-beec-85c787a2c7dc")
|
| 8 |
if not ARK_API_KEY:
|
| 9 |
raise ValueError("ARK_API_KEY not found. Please set it in Space Secrets.")
|
| 10 |
|
|
|
|
| 156 |
|
| 157 |
chatbot_component = gr.Chatbot(
|
| 158 |
label="聊天窗口",
|
| 159 |
+
# type='messages', # 确保使用 'messages' 类型,以便更好地处理头像和角色
|
| 160 |
avatar_images=("images/user_avatar.png", "images/bot_avatar.png"),
|
| 161 |
height=500,
|
| 162 |
show_label=False # 隐藏 Chatbot 自己的标签,因为上面已经有标题了
|
|
|
|
| 169 |
examples=[
|
| 170 |
["你好呀!"],
|
| 171 |
["给我讲个关于太空的笑话。"],
|
| 172 |
+
["用Python写一个快速排序算法。"]
|
| 173 |
],
|
| 174 |
submit_btn="➤ 发送",
|
| 175 |
)
|
requirements.txt
CHANGED
|
@@ -1,58 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
anyio==4.9.0
|
| 4 |
-
certifi==2025.4.26
|
| 5 |
-
charset-normalizer==3.4.2
|
| 6 |
-
click==8.2.1
|
| 7 |
-
distro==1.9.0
|
| 8 |
-
exceptiongroup==1.3.0
|
| 9 |
-
fastapi==0.115.12
|
| 10 |
-
ffmpy==0.6.0
|
| 11 |
-
filelock==3.18.0
|
| 12 |
-
fsspec==2025.5.1
|
| 13 |
-
gradio==5.33.0
|
| 14 |
-
gradio_client==1.10.2
|
| 15 |
-
groovy==0.1.2
|
| 16 |
-
h11==0.16.0
|
| 17 |
-
hf-xet==1.1.3
|
| 18 |
-
httpcore==1.0.9
|
| 19 |
-
httpx==0.28.1
|
| 20 |
-
huggingface-hub==0.32.4
|
| 21 |
-
idna==3.10
|
| 22 |
-
Jinja2==3.1.6
|
| 23 |
-
jiter==0.10.0
|
| 24 |
-
markdown-it-py==3.0.0
|
| 25 |
-
MarkupSafe==3.0.2
|
| 26 |
-
mdurl==0.1.2
|
| 27 |
-
numpy==2.2.6
|
| 28 |
-
openai==1.84.0
|
| 29 |
-
orjson==3.10.18
|
| 30 |
-
packaging==25.0
|
| 31 |
-
pandas==2.3.0
|
| 32 |
-
pillow==11.2.1
|
| 33 |
-
pydantic==2.11.5
|
| 34 |
-
pydantic_core==2.33.2
|
| 35 |
-
pydub==0.25.1
|
| 36 |
-
Pygments==2.19.1
|
| 37 |
-
python-dateutil==2.9.0.post0
|
| 38 |
-
python-multipart==0.0.20
|
| 39 |
-
pytz==2025.2
|
| 40 |
-
PyYAML==6.0.2
|
| 41 |
-
requests==2.32.3
|
| 42 |
-
rich==14.0.0
|
| 43 |
-
ruff==0.11.12
|
| 44 |
-
safehttpx==0.1.6
|
| 45 |
-
semantic-version==2.10.0
|
| 46 |
-
shellingham==1.5.4
|
| 47 |
-
six==1.17.0
|
| 48 |
-
sniffio==1.3.1
|
| 49 |
-
starlette==0.46.2
|
| 50 |
-
tomlkit==0.13.3
|
| 51 |
-
tqdm==4.67.1
|
| 52 |
-
typer==0.16.0
|
| 53 |
-
typing-inspection==0.4.1
|
| 54 |
-
typing_extensions==4.14.0
|
| 55 |
-
tzdata==2025.2
|
| 56 |
-
urllib3==2.4.0
|
| 57 |
-
uvicorn==0.34.3
|
| 58 |
-
websockets==15.0.1
|
|
|
|
| 1 |
+
gradio==5.1.0
|
| 2 |
+
openai==1.84.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|