Spaces:
Running
Running
~UI
Browse files
app.py
CHANGED
@@ -94,22 +94,23 @@ with gr.Blocks(css=css) as demo:
|
|
94 |
Prompt templates from [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts).""",
|
95 |
elem_id="header")
|
96 |
|
97 |
-
with gr.
|
98 |
with gr.Row():
|
99 |
gr.Markdown("Enter your own OpenAI API Key. You can get one [here](https://platform.openai.com/account/api-keys).", elem_id="label")
|
100 |
user_token = gr.Textbox(value='stub', placeholder="OpenAI API Key", type="password", show_label=False)
|
101 |
-
with gr.
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
113 |
|
114 |
gr.HTML('''<br><br><br><center><a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>You can duplicate this Space.<br>
|
115 |
Don't forget to set your own <a href="https://platform.openai.com/account/api-keys">OpenAI API Key</a> environment variable in Settings.<br>
|
|
|
94 |
Prompt templates from [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts).""",
|
95 |
elem_id="header")
|
96 |
|
97 |
+
with gr.Column():
|
98 |
with gr.Row():
|
99 |
gr.Markdown("Enter your own OpenAI API Key. You can get one [here](https://platform.openai.com/account/api-keys).", elem_id="label")
|
100 |
user_token = gr.Textbox(value='stub', placeholder="OpenAI API Key", type="password", show_label=False)
|
101 |
+
with gr.Row():
|
102 |
+
with gr.Column():
|
103 |
+
chatbot = gr.Chatbot(elem_id="chatbox")
|
104 |
+
input_message = gr.Textbox(show_label=False, placeholder="Enter text and press enter", visible=True).style(container=False)
|
105 |
+
btn_submit = gr.Button("Submit")
|
106 |
+
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
107 |
+
btn_clear_conversation = gr.Button("๐ Start New Conversation")
|
108 |
+
with gr.Column():
|
109 |
+
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
110 |
+
prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
|
111 |
+
with gr.Accordion("Advanced parameters", open=False):
|
112 |
+
temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, interactive=True, label="Temperature (higher = more creative/chaotic)")
|
113 |
+
max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, interactive=True, label="Max tokens per response")
|
114 |
|
115 |
gr.HTML('''<br><br><br><center><a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>You can duplicate this Space.<br>
|
116 |
Don't forget to set your own <a href="https://platform.openai.com/account/api-keys">OpenAI API Key</a> environment variable in Settings.<br>
|