Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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")
|
|
|
|
|
|
|
|
|
|
| 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
|