Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ with gr.Blocks(css=css) as demo:
|
|
125 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
126 |
with gr.Column():
|
127 |
gr.Markdown("OpenAI API Key.", elem_id="label")
|
128 |
-
user_token=gr.Textbox(value=API, type="password", placeholder=API, visible=
|
129 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
130 |
prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview", visible=False)
|
131 |
with gr.Accordion("Advanced parameters", open=False, visible=False):
|
@@ -139,7 +139,7 @@ with gr.Blocks(css=css) as demo:
|
|
139 |
input_message.submit(submit_message, [user_token, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
140 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
141 |
prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[prompt_template_preview])
|
142 |
-
user_token.
|
143 |
|
144 |
|
145 |
demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template], queur=False)
|
|
|
125 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
126 |
with gr.Column():
|
127 |
gr.Markdown("OpenAI API Key.", elem_id="label")
|
128 |
+
user_token=gr.Textbox(value=API, type="password", placeholder=API, visible=True, readonly=True)
|
129 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
130 |
prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview", visible=False)
|
131 |
with gr.Accordion("Advanced parameters", open=False, visible=False):
|
|
|
139 |
input_message.submit(submit_message, [user_token, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
140 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
141 |
prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[prompt_template_preview])
|
142 |
+
user_token.submit(on_token_change, inputs=[user_token], outputs=[])
|
143 |
|
144 |
|
145 |
demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template], queur=False)
|