Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ import csv
|
|
6 |
|
7 |
prompt_templates = {"Default ChatGPT": ""}
|
8 |
|
|
|
|
|
9 |
def get_empty_state():
|
10 |
return {"total_tokens": 0, "messages": []}
|
11 |
|
@@ -111,7 +113,7 @@ with gr.Blocks(css=css) as demo:
|
|
111 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
112 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
113 |
with gr.Column():
|
114 |
-
user_token = gr.Textbox(value=
|
115 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
116 |
prompt_template_preview = gr.Textbox(value="prompt_template_preview", type="text", show_label=False)
|
117 |
with gr.Accordion("Advanced parameters", open=False):
|
|
|
6 |
|
7 |
prompt_templates = {"Default ChatGPT": ""}
|
8 |
|
9 |
+
open_ai_key = st.secrets["open_ai_key"]
|
10 |
+
|
11 |
def get_empty_state():
|
12 |
return {"total_tokens": 0, "messages": []}
|
13 |
|
|
|
113 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
114 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
115 |
with gr.Column():
|
116 |
+
user_token = gr.Textbox(value=open_ai_key, placeholder="OpenAI API Key", type="password", show_label=False)
|
117 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
118 |
prompt_template_preview = gr.Textbox(value="prompt_template_preview", type="text", show_label=False)
|
119 |
with gr.Accordion("Advanced parameters", open=False):
|