Spaces:
Sleeping
Sleeping
File size: 1,150 Bytes
5f613ea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | """
Quick test to verify environment variables are loaded correctly
"""
import os
from dotenv import load_dotenv
load_dotenv()
def test_env_vars():
"""Test if required environment variables are available"""
required_vars = [
"AZURE_OPENAI_ENDPOINT",
"AZURE_OPENAI_KEY",
"AZURE_OPENAI_API_VERSION",
"AZURE_OPENAI_LLM_DEPLOYMENT",
"AZURE_OPENAI_LLM_MODEL"
]
print("π Environment Variables Check")
print("=" * 40)
all_present = True
for var in required_vars:
value = os.getenv(var)
if value and value.strip():
print(f"β
{var}: Present")
else:
print(f"β {var}: Missing or empty")
all_present = False
print("=" * 40)
if all_present:
print("π All environment variables are properly configured!")
print("β
Your app should work in Hugging Face Spaces")
else:
print("β οΈ Some environment variables are missing")
print("π§ Set them in Hugging Face Spaces Repository Secrets")
return all_present
if __name__ == "__main__":
test_env_vars()
|