anzorq commited on
Commit
2feb5a4
β€’
1 Parent(s): b8e532f
Files changed (1) hide show
  1. app.py +14 -13
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.Row():
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.Column():
102
- chatbot = gr.Chatbot(elem_id="chatbox")
103
- input_message = gr.Textbox(show_label=False, placeholder="Enter text and press enter", visible=True).style(container=False)
104
- btn_submit = gr.Button("Submit")
105
- total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
106
- btn_clear_conversation = gr.Button("πŸ”ƒ Start New Conversation")
107
- with gr.Column():
108
- prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
109
- prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
110
- with gr.Accordion("Advanced parameters", open=False):
111
- temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, interactive=True, label="Temperature (higher = more creative/chaotic)")
112
- max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, interactive=True, label="Max tokens per response")
 
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>