Funpee commited on
Commit
e410df2
·
1 Parent(s): e4e2d86

修改为不依赖 GPU 支持

Browse files
Files changed (2) hide show
  1. app.py +0 -5
  2. requirements.txt +2 -0
app.py CHANGED
@@ -4,16 +4,11 @@ import json
4
  import sseclient
5
  import sys
6
  import os
7
- import spaces
8
- import torch
9
 
10
  COZE_API_URL = "https://api.coze.cn/v3/chat"
11
  API_KEY = os.environ.get("COZE_API_KEY", "your_default_key")
12
  BOT_ID = os.environ.get("COZE_BOT_ID", "your_default_bot_id")
13
 
14
- # 初始化 GPU tensor
15
- zero = torch.Tensor([0]).cuda()
16
-
17
  @spaces.GPU
18
  def chat_stream(message, history):
19
  # 验证 GPU 是否可用
 
4
  import sseclient
5
  import sys
6
  import os
 
 
7
 
8
  COZE_API_URL = "https://api.coze.cn/v3/chat"
9
  API_KEY = os.environ.get("COZE_API_KEY", "your_default_key")
10
  BOT_ID = os.environ.get("COZE_BOT_ID", "your_default_bot_id")
11
 
 
 
 
12
  @spaces.GPU
13
  def chat_stream(message, history):
14
  # 验证 GPU 是否可用
requirements.txt CHANGED
@@ -1,3 +1,5 @@
 
1
  gradio
2
  requests
3
  sseclient-py
 
 
1
+ torch
2
  gradio
3
  requests
4
  sseclient-py
5
+