Update app.py
Browse files
app.py
CHANGED
@@ -133,7 +133,7 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
133 |
system_msg = gr.Textbox(label="Instruct the AI Assistant to set its beaviour", info = system_msg_info, value="")
|
134 |
accordion_msg = gr.HTML(value="🚧 To set System message you will have to refresh the app", visible=False)
|
135 |
chatbot = gr.Chatbot(label='GPT4', elem_id="chatbot")
|
136 |
-
inputs = gr.Textbox(placeholder= "
|
137 |
state = gr.State([])
|
138 |
with gr.Row():
|
139 |
with gr.Column(scale=7):
|
@@ -148,9 +148,8 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
148 |
chat_counter = gr.Number(value=0, visible=False, precision=0)
|
149 |
|
150 |
#Event handling
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
|
155 |
inputs.submit(set_visible_false, [], [system_msg])
|
156 |
b1.click(set_visible_false, [], [system_msg])
|
@@ -190,5 +189,5 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
190 |
["You are a tech-savvy assistant who can help users troubleshoot issues and answer questions about gadgets and software."],
|
191 |
["You are an AI poet who can compose creative and evocative poems on any given topic."],],
|
192 |
inputs = system_msg,)
|
193 |
-
|
194 |
demo.queue(max_size=20, concurrency_count=20).launch(debug=True)
|
|
|
133 |
system_msg = gr.Textbox(label="Instruct the AI Assistant to set its beaviour", info = system_msg_info, value="")
|
134 |
accordion_msg = gr.HTML(value="🚧 To set System message you will have to refresh the app", visible=False)
|
135 |
chatbot = gr.Chatbot(label='GPT4', elem_id="chatbot")
|
136 |
+
inputs = gr.Textbox(placeholder= "Hi there!", label= "Type an input and press Enter")
|
137 |
state = gr.State([])
|
138 |
with gr.Row():
|
139 |
with gr.Column(scale=7):
|
|
|
148 |
chat_counter = gr.Number(value=0, visible=False, precision=0)
|
149 |
|
150 |
#Event handling
|
151 |
+
inputs.submit( predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code],) #openai_api_key
|
152 |
+
b1.click( predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code],) #openai_api_key
|
|
|
153 |
|
154 |
inputs.submit(set_visible_false, [], [system_msg])
|
155 |
b1.click(set_visible_false, [], [system_msg])
|
|
|
189 |
["You are a tech-savvy assistant who can help users troubleshoot issues and answer questions about gadgets and software."],
|
190 |
["You are an AI poet who can compose creative and evocative poems on any given topic."],],
|
191 |
inputs = system_msg,)
|
192 |
+
|
193 |
demo.queue(max_size=20, concurrency_count=20).launch(debug=True)
|