Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -93,68 +93,68 @@ with gr.Blocks() as block:
|
|
93 |
chatbot = gr.Chatbot(elem_id='chatbot')
|
94 |
instruction_txtbox = gr.Textbox(placeholder="What do you want to say to AI?", label="Instruction")
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
159 |
block.load(
|
160 |
None,
|
|
|
93 |
chatbot = gr.Chatbot(elem_id='chatbot')
|
94 |
instruction_txtbox = gr.Textbox(placeholder="What do you want to say to AI?", label="Instruction")
|
95 |
|
96 |
+
first.click(
|
97 |
+
initialize,
|
98 |
+
local_data,
|
99 |
+
local_data
|
100 |
+
).then(
|
101 |
+
set_chatbot,
|
102 |
+
[first, local_data],
|
103 |
+
[chatbot, idx]
|
104 |
+
)
|
105 |
+
|
106 |
+
second.click(
|
107 |
+
initialize,
|
108 |
+
local_data,
|
109 |
+
local_data
|
110 |
+
).then(
|
111 |
+
set_chatbot,
|
112 |
+
[second, local_data],
|
113 |
+
[chatbot, idx]
|
114 |
+
)
|
115 |
+
|
116 |
+
third.click(
|
117 |
+
initialize,
|
118 |
+
local_data,
|
119 |
+
local_data
|
120 |
+
).then(
|
121 |
+
set_chatbot,
|
122 |
+
[third, local_data],
|
123 |
+
[chatbot, idx]
|
124 |
+
)
|
125 |
+
|
126 |
+
fourth.click(
|
127 |
+
initialize,
|
128 |
+
local_data,
|
129 |
+
local_data
|
130 |
+
).then(
|
131 |
+
set_chatbot,
|
132 |
+
[fourth, local_data],
|
133 |
+
[chatbot, idx]
|
134 |
+
)
|
135 |
+
|
136 |
+
fifth.click(
|
137 |
+
initialize,
|
138 |
+
local_data,
|
139 |
+
local_data
|
140 |
+
).then(
|
141 |
+
set_chatbot,
|
142 |
+
[fifth, local_data],
|
143 |
+
[chatbot, idx]
|
144 |
+
)
|
145 |
+
|
146 |
+
instruction_txtbox.submit(
|
147 |
+
initialize,
|
148 |
+
local_data,
|
149 |
+
local_data
|
150 |
+
).then(
|
151 |
+
add_pingpong,
|
152 |
+
[idx, local_data, instruction_txtbox],
|
153 |
+
[chatbot, local_data]
|
154 |
+
).then(
|
155 |
+
None, local_data, None,
|
156 |
+
_js="(v)=>{ setStorage('local_data',v) }"
|
157 |
+
)
|
158 |
|
159 |
block.load(
|
160 |
None,
|