Skier8402 commited on
Commit
befdd15
·
1 Parent(s): 677cca4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -42,9 +42,12 @@ def main():
42
  load_dotenv()
43
 
44
  # inform the user that the api key is loaded
45
- if OPENAI_API_KEY is not None and OPENAI_API_KEY != "":
46
- st.write("OpenAI API key loaded")
47
-
 
 
 
48
  # inform user that the model being used is the turbo model
49
  st.write("Using the gpt-3.5-turbo-0613 model from OpenAI")
50
 
 
42
  load_dotenv()
43
 
44
  # inform the user that the api key is loaded
45
+ if os.getenv("OPENAI_API_KEY") is None or os.getenv("OPENAI_API_KEY") == "":
46
+ print("OPENAI_API_KEY is not set")
47
+ exit(1)
48
+ else:
49
+ print("OPENAI_API_KEY is set")
50
+
51
  # inform user that the model being used is the turbo model
52
  st.write("Using the gpt-3.5-turbo-0613 model from OpenAI")
53