Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,10 @@ import math
|
|
| 6 |
import tempfile
|
| 7 |
|
| 8 |
# 从环境变量读取 API Key(Hugging Face Spaces 安全设置)
|
|
|
|
| 9 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def seconds_to_srt_time(seconds: float) -> str:
|
| 12 |
ms = int((seconds - int(seconds)) * 1000)
|
|
|
|
| 6 |
import tempfile
|
| 7 |
|
| 8 |
# 从环境变量读取 API Key(Hugging Face Spaces 安全设置)
|
| 9 |
+
print("程序启动,开始读取 API Key")
|
| 10 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 11 |
+
print(f"读取到 API Key,长度: {len(openai.api_key) if openai.api_key else 'None'}")
|
| 12 |
+
|
| 13 |
|
| 14 |
def seconds_to_srt_time(seconds: float) -> str:
|
| 15 |
ms = int((seconds - int(seconds)) * 1000)
|