Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,7 @@ Will not describe your needs to ChatGPT?You Use [ChatGPT Shortcut](https://new
|
|
100 |
with gr.Blocks() as demo:
|
101 |
gr.HTML(title)
|
102 |
chatbot = gr.Chatbot().style(color_map=("#1D51EE", "#585A5B"))
|
|
|
103 |
context = gr.State([])
|
104 |
systemPrompt = gr.State(update_system(initial_prompt))
|
105 |
|
@@ -108,7 +109,7 @@ with gr.Blocks() as demo:
|
|
108 |
txt = gr.Textbox(show_label=False, placeholder="Please enter any of your needs here").style(container=False)
|
109 |
with gr.Column(min_width=50, scale=1):
|
110 |
#submitBtn = gr.Button("🚀 Submit", variant="Primary", color="#A238FF")
|
111 |
-
submitBtn = gr.Button("🚀 Submit")
|
112 |
with gr.Row():
|
113 |
emptyBtn = gr.Button("🧹 New conversation")
|
114 |
retryBtn = gr.Button("🔄 Resubmit")
|
@@ -120,17 +121,17 @@ with gr.Blocks() as demo:
|
|
120 |
|
121 |
#gr.Markdown(description)
|
122 |
|
123 |
-
txt.submit(predict, [
|
124 |
txt.submit(lambda :"", None, txt)
|
125 |
submitBtn.click(predict, [chatbot, txt, systemPrompt, context], [chatbot, context], show_progress=True)
|
126 |
submitBtn.click(lambda :"", None, txt)
|
127 |
-
emptyBtn.click(reset_state, outputs=[chatbot, context])
|
128 |
#newSystemPrompt.submit(update_system, newSystemPrompt, systemPrompt)
|
129 |
#newSystemPrompt.submit(lambda x: x, newSystemPrompt, systemPromptDisplay)
|
130 |
#newSystemPrompt.submit(lambda :"", None, newSystemPrompt)
|
131 |
-
retryBtn.click(retry, [chatbot, systemPrompt, context], [chatbot, context], show_progress=True)
|
132 |
-
delLastBtn.click(delete_last_conversation, [chatbot, context], [chatbot, context], show_progress=True)
|
133 |
-
reduceTokenBtn.click(reduce_token, [chatbot, systemPrompt, context], [chatbot, context], show_progress=True)
|
134 |
|
135 |
|
136 |
demo.launch()
|
|
|
100 |
with gr.Blocks() as demo:
|
101 |
gr.HTML(title)
|
102 |
chatbot = gr.Chatbot().style(color_map=("#1D51EE", "#585A5B"))
|
103 |
+
chatbot2 = gr.Chatbot().style(color_map=("#A238FF", "#A238FF"))
|
104 |
context = gr.State([])
|
105 |
systemPrompt = gr.State(update_system(initial_prompt))
|
106 |
|
|
|
109 |
txt = gr.Textbox(show_label=False, placeholder="Please enter any of your needs here").style(container=False)
|
110 |
with gr.Column(min_width=50, scale=1):
|
111 |
#submitBtn = gr.Button("🚀 Submit", variant="Primary", color="#A238FF")
|
112 |
+
submitBtn = gr.Button("🚀 Submit")
|
113 |
with gr.Row():
|
114 |
emptyBtn = gr.Button("🧹 New conversation")
|
115 |
retryBtn = gr.Button("🔄 Resubmit")
|
|
|
121 |
|
122 |
#gr.Markdown(description)
|
123 |
|
124 |
+
txt.submit(predict, [chatbot2, txt, systemPrompt, context], [chatbot2, context], show_progress=True)
|
125 |
txt.submit(lambda :"", None, txt)
|
126 |
submitBtn.click(predict, [chatbot, txt, systemPrompt, context], [chatbot, context], show_progress=True)
|
127 |
submitBtn.click(lambda :"", None, txt)
|
128 |
+
#emptyBtn.click(reset_state, outputs=[chatbot, context])
|
129 |
#newSystemPrompt.submit(update_system, newSystemPrompt, systemPrompt)
|
130 |
#newSystemPrompt.submit(lambda x: x, newSystemPrompt, systemPromptDisplay)
|
131 |
#newSystemPrompt.submit(lambda :"", None, newSystemPrompt)
|
132 |
+
#retryBtn.click(retry, [chatbot, systemPrompt, context], [chatbot, context], show_progress=True)
|
133 |
+
#delLastBtn.click(delete_last_conversation, [chatbot, context], [chatbot, context], show_progress=True)
|
134 |
+
#reduceTokenBtn.click(reduce_token, [chatbot, systemPrompt, context], [chatbot, context], show_progress=True)
|
135 |
|
136 |
|
137 |
demo.launch()
|