Spaces:
Paused
Paused
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -4,9 +4,9 @@ import gradio as gr
|
|
| 4 |
import openai
|
| 5 |
|
| 6 |
# Load OpenAI API key from environment
|
| 7 |
-
openai_api_key = os.
|
| 8 |
-
if
|
| 9 |
-
|
| 10 |
openai.api_key = openai_api_key
|
| 11 |
|
| 12 |
def improve_code(user_code, language):
|
|
|
|
| 4 |
import openai
|
| 5 |
|
| 6 |
# Load OpenAI API key from environment
|
| 7 |
+
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 8 |
+
if not openai_api_key:
|
| 9 |
+
openai_api_key = ""
|
| 10 |
openai.api_key = openai_api_key
|
| 11 |
|
| 12 |
def improve_code(user_code, language):
|