Fishead_East commited on
Commit
23ae363
1 Parent(s): ea23f28

测试HF环境变量

Browse files
Files changed (1) hide show
  1. LLM/spark_desk.py +9 -2
LLM/spark_desk.py CHANGED
@@ -29,8 +29,15 @@ class SparkDesk(LLM):
29
  """
30
 
31
  url = "wss://spark-api.xf-yun.com/v1.1/chat"
32
- load_dotenv(find_dotenv('.env'))
33
- APPID = os.getenv("APPID") # 环境变量
 
 
 
 
 
 
 
34
  APIKey = os.getenv("APIKEY")
35
  APISecret = os.getenv("APISECRET")
36
 
 
29
  """
30
 
31
  url = "wss://spark-api.xf-yun.com/v1.1/chat"
32
+
33
+ # # 本地调试时使用,加载.env文件
34
+ # load_dotenv(find_dotenv('.env'))
35
+ # APPID = os.getenv("APPID") # 环境变量
36
+ # APIKey = os.getenv("APIKEY")
37
+ # APISecret = os.getenv("APISECRET")
38
+
39
+ # HF部署时使用,直接加载Hub上设置的环境变量
40
+ APPID = os.environ.get("APPID")
41
  APIKey = os.getenv("APIKEY")
42
  APISecret = os.getenv("APISECRET")
43