Spaces:
Runtime error
Runtime error
move key to env.
Browse files
app.py
CHANGED
|
@@ -3,10 +3,10 @@ import openai
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
#if you have OpenAI API key as an environment variable, enable the below
|
| 6 |
-
|
| 7 |
|
| 8 |
#if you have OpenAI API key as a string, enable the below
|
| 9 |
-
openai.api_key = "
|
| 10 |
|
| 11 |
start_sequence = "\nAI:"
|
| 12 |
restart_sequence = "\nHuman: "
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
#if you have OpenAI API key as an environment variable, enable the below
|
| 6 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 7 |
|
| 8 |
#if you have OpenAI API key as a string, enable the below
|
| 9 |
+
openai.api_key = ""
|
| 10 |
|
| 11 |
start_sequence = "\nAI:"
|
| 12 |
restart_sequence = "\nHuman: "
|