SammyGasana commited on
Commit
6fe26c1
·
verified ·
1 Parent(s): 201f0be

Update main.py

Browse files

access update fr api

Files changed (1) hide show
  1. main.py +8 -1
main.py CHANGED
@@ -14,8 +14,15 @@ from audio_predictions import AudioTranslation
14
  # Retrieve API key from .env file
15
  # API_KEY = os.getenv('OPENAI_API_KEY')
16
 
 
 
17
  API_KEY = os.getenv('OPENAI_API_KEY')
18
- openai.api_key = API_KEY
 
 
 
 
 
19
  # Set the API key for OpenAI
20
  # openai.api_key = API_KEY
21
  dataset_path = 'updated_company_tweets.csv'
 
14
  # Retrieve API key from .env file
15
  # API_KEY = os.getenv('OPENAI_API_KEY')
16
 
17
+
18
+
19
  API_KEY = os.getenv('OPENAI_API_KEY')
20
+ if API_KEY:
21
+ openai.api_key = API_KEY
22
+ else:
23
+ print("No API key provided. Please set the OPENAI_API_KEY environment variable.")
24
+ # Implement fallback behavior or exit gracefully
25
+
26
  # Set the API key for OpenAI
27
  # openai.api_key = API_KEY
28
  dataset_path = 'updated_company_tweets.csv'