mrli008 commited on
Commit
d400f39
·
verified ·
1 Parent(s): ea3f6c8

Update app.py

Browse files

添加key和base_url用于执行测试

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -19,7 +19,7 @@ import json
19
 
20
 
21
  # 初始化OpenAI客户端
22
- client = openai.OpenAI(api_key=os.environ["OPENAI_API_KEY"], base_url="https://api.openai.com/v1/")
23
 
24
  def transcribe_audio(audio_path: str) -> str:
25
  """将语音文件转为文本"""
 
19
 
20
 
21
  # 初始化OpenAI客户端
22
+ client = openai.OpenAI(api_key=os.environ.get("OPENAI_API_KEY",''), base_url=os.environ.get("OPENAI_BASE_URL","https://api.openai.com/v1/"))
23
 
24
  def transcribe_audio(audio_path: str) -> str:
25
  """将语音文件转为文本"""