Bhanumani12 commited on
Commit
c98e4d9
·
verified ·
1 Parent(s): 145b872

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -3,8 +3,11 @@ from transformers import pipeline
3
  import openai
4
  import os
5
 
6
- # Get OpenAI API key securely
7
- openai_api_key = os.getenv("OPENAI_API_KEY") or "sk-your-correct-key-here"
 
 
 
8
  client = openai.OpenAI(api_key=openai_api_key)
9
 
10
  # Load local model for code classification
 
3
  import openai
4
  import os
5
 
6
+ # Get OpenAI API key securely (without fallback to dummy key)
7
+ openai_api_key = os.getenv("OPENAI_API_KEY")
8
+ if not openai_api_key:
9
+ raise ValueError("❌ OPENAI_API_KEY environment variable not set.")
10
+
11
  client = openai.OpenAI(api_key=openai_api_key)
12
 
13
  # Load local model for code classification