Demosthene-OR commited on
Commit
88b0104
·
1 Parent(s): 6ae3a1b

Update playground.py

Browse files
Files changed (1) hide show
  1. tabs/playground.py +3 -2
tabs/playground.py CHANGED
@@ -10,7 +10,8 @@ warnings.filterwarnings('ignore')
10
  # if st.session_state.Cloud == 0:
11
  # load_dotenv()
12
  # os.getenv("OPENAI_API_KEY")
13
- openai.api_key = st.session_state['OPENAI_API_KEY'] # os.environ['OPENAI_API_KEY']
 
14
 
15
  title = "Playground ChatGPT"
16
  sidebar_name = "Playground"
@@ -87,7 +88,7 @@ def run():
87
  """)
88
  , unsafe_allow_html=True)
89
  st.write(os.environ['OPENAI_API_KEY'])
90
- if openai.api_key!="":
91
  try:
92
  col1, col2 = st.columns([3, 1])
93
  with col2:
 
10
  # if st.session_state.Cloud == 0:
11
  # load_dotenv()
12
  # os.getenv("OPENAI_API_KEY")
13
+ if 'OPENAI_API_KEY' not in st.session_state:
14
+ openai.api_key = st.session_state['OPENAI_API_KEY'] # os.environ['OPENAI_API_KEY']
15
 
16
  title = "Playground ChatGPT"
17
  sidebar_name = "Playground"
 
88
  """)
89
  , unsafe_allow_html=True)
90
  st.write(os.environ['OPENAI_API_KEY'])
91
+ if 'OPENAI_API_KEY' not in st.session_state:
92
  try:
93
  col1, col2 = st.columns([3, 1])
94
  with col2: