Dagfinn1962 commited on
Commit
9aff0f1
1 Parent(s): fa73741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -2,6 +2,7 @@ import openai
2
  import time
3
  import logging
4
  import gradio as gr
 
5
 
6
 
7
  #def my_function():
@@ -141,17 +142,17 @@ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
141
  """
142
  )
143
  conversation = Chat()
144
- with gr.Row():
145
- with gr.Column():
146
- # to do: change to openaikey input for public release
147
- openai_key = gr.Textbox(
148
- label="OpenAI Key",
149
- value="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",
150
- type="text",
151
- placeholder="",
152
- info="",
153
- show_label=False,
154
- )
155
  chatbot = gr.Chatbot().style(height=400)
156
  with gr.Row():
157
  with gr.Column():
 
2
  import time
3
  import logging
4
  import gradio as gr
5
+ import os
6
 
7
 
8
  #def my_function():
 
142
  """
143
  )
144
  conversation = Chat()
145
+ with gr.Row():
146
+ with gr.Column():
147
+ openai_key = gr.Textbox(
148
+ label="OpenAI Key",
149
+ api_key=os.environ.get('API_KEY'),
150
+ value ="api_key", # Update with placeholder value
151
+ type="text",
152
+ placeholder="",
153
+ info="",
154
+ show_label=False,
155
+ )
156
  chatbot = gr.Chatbot().style(height=400)
157
  with gr.Row():
158
  with gr.Column():