chansung commited on
Commit
c542f6a
·
1 Parent(s): da24464

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +62 -62
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
- 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,
 
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,