We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e31c8b2 commit f6ca242Copy full SHA for f6ca242
app.py
@@ -19,7 +19,11 @@
19
# auth with a bearer api key, whose hash is stored in the environment variable API_KEY_HASH
20
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
21
API_KEY_HASH = os.getenv("API_KEY_HASH")
22
-assert API_KEY_HASH, "API_KEY_HASH environment variable must be set"
+if not API_KEY_HASH and os.path.exists("/run/secrets/api_key_hash"):
23
+ with open("/run/secrets/api_key_hash", "r") as f:
24
+ API_KEY_HASH = f.read().strip()
25
+
26
+assert API_KEY_HASH, "API_KEY_HASH must be set"
27
28
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
29
0 commit comments