Spaces:
Runtime error
Runtime error
~UI
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
|
|
2 |
import os
|
3 |
import openai
|
4 |
import requests
|
5 |
-
import json
|
6 |
import csv
|
7 |
|
8 |
|
@@ -96,6 +95,9 @@ with gr.Blocks(css=css) as demo:
|
|
96 |
elem_id="header")
|
97 |
|
98 |
with gr.Row():
|
|
|
|
|
|
|
99 |
with gr.Column():
|
100 |
chatbot = gr.Chatbot(elem_id="chatbox")
|
101 |
input_message = gr.Textbox(show_label=False, placeholder="Enter text and press enter", visible=True).style(container=False)
|
@@ -103,8 +105,6 @@ with gr.Blocks(css=css) as demo:
|
|
103 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
104 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
105 |
with gr.Column():
|
106 |
-
gr.Markdown("Enter your own OpenAI API Key. You can get one [here](https://platform.openai.com/account/api-keys).", elem_id="label")
|
107 |
-
user_token = gr.Textbox(placeholder="OpenAI API Key", type="password", show_label=False)
|
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):
|
|
|
2 |
import os
|
3 |
import openai
|
4 |
import requests
|
|
|
5 |
import csv
|
6 |
|
7 |
|
|
|
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)
|
|
|
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):
|