nisargvp commited on
Commit
c16a691
1 Parent(s): 18930b2

keys error handling added

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -24,9 +24,12 @@ load_dotenv()
24
  """
25
  We will load our environment variables here.
26
  """
27
- HF_LLM_ENDPOINT = os.environ["HF_LLM_ENDPOINT"]
28
- HF_EMBED_ENDPOINT = os.environ["HF_EMBED_ENDPOINT"]
29
- HF_TOKEN = os.environ["HF_TOKEN"]
 
 
 
30
 
31
  # ---- GLOBAL DECLARATIONS ---- #
32
 
 
24
  """
25
  We will load our environment variables here.
26
  """
27
+ try:
28
+ HF_LLM_ENDPOINT = os.environ['HF_LLM_ENDPOINT']
29
+ HF_EMBED_ENDPOINT = os.environ['HF_EMBED_ENDPOINT']
30
+ HF_TOKEN = os.environ['HF_TOKEN']
31
+ except KeyError as e:
32
+ raise EnvironmentError(f"Missing environment variable: {e}")
33
 
34
  # ---- GLOBAL DECLARATIONS ---- #
35