Ver Fonte

Merge pull request #1634 from open-webui/dev

fix
Timothy Jaeryang Baek há 1 ano atrás
pai
commit
c533ed91f5
1 ficheiros alterados com 8 adições e 3 exclusões
  1. 8 3
      backend/config.py

+ 8 - 3
backend/config.py

@@ -322,9 +322,14 @@ OPENAI_API_BASE_URLS = [
 ]
 
 OPENAI_API_KEY = ""
-OPENAI_API_KEY = OPENAI_API_KEYS[
-    OPENAI_API_BASE_URLS.index("https://api.openai.com/v1")
-]
+
+try:
+    OPENAI_API_KEY = OPENAI_API_KEYS[
+        OPENAI_API_BASE_URLS.index("https://api.openai.com/v1")
+    ]
+except:
+    pass
+
 OPENAI_API_BASE_URL = "https://api.openai.com/v1"