Quent1Fvr commited on
Commit
780eef0
1 Parent(s): 3058564

Update src/view/view.py

Browse files
Files changed (1) hide show
  1. src/view/view.py +10 -5
src/view/view.py CHANGED
@@ -133,6 +133,8 @@ def run(ctrl: Chatbot, config: {}):
133
  update_ = {
134
  histo_text_comp: gr.update(visible=True, value=histo_text_),
135
  input_example_comp: gr.update(visible=False,),
 
 
136
  }
137
  for i in range(4):
138
  update_[source_text_comp[i]] = gr.update(visible=False)
@@ -144,6 +146,7 @@ def run(ctrl: Chatbot, config: {}):
144
  update_ = {
145
  histo_text_comp: gr.update(value=histo_text_),
146
  input_text_comp: gr.update(value=''),
 
147
  }
148
  for i in range(min(len(sources), 3)):
149
  s = sources[i]
@@ -162,6 +165,7 @@ def run(ctrl: Chatbot, config: {}):
162
  input_text_comp: gr.update(value=input_example_),
163
  histo_text_comp: gr.update(visible=True, value=histo_text_),
164
  input_example_comp: gr.update(visible=False, value=''),
 
165
  }
166
  for i in range(4):
167
  update_[source_text_comp[i]] = gr.update(visible=False)
@@ -173,6 +177,7 @@ def run(ctrl: Chatbot, config: {}):
173
  histo_text_comp: gr.update(value='', visible=False),
174
  input_example_comp: gr.update(value='', visible=True),
175
  upload_another_doc_btn: gr.update(visible=True),
 
176
  }
177
  for i in range(4):
178
  update_[source_text_comp[i]] = gr.update(visible=False, value='hello')
@@ -250,24 +255,24 @@ def run(ctrl: Chatbot, config: {}):
250
  input_text_comp \
251
  .submit(input_text_fn1,
252
  inputs=[input_text_comp, histo_text_comp],
253
- outputs=[histo_text_comp, input_example_comp,
254
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])\
255
  .then(input_text_fn2,
256
  inputs=[input_text_comp, histo_text_comp],
257
- outputs=[input_text_comp, histo_text_comp,
258
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
259
  input_example_comp \
260
  .input(input_example_fn,
261
  inputs=[input_example_comp, histo_text_comp],
262
- outputs=[input_text_comp, histo_text_comp, input_example_comp,
263
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])\
264
  .then(input_text_fn2,
265
  inputs=[input_text_comp, histo_text_comp],
266
- outputs=[input_text_comp, histo_text_comp,
267
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
268
  clear_btn.click(clear_fn,
269
  inputs=None,
270
- outputs=[input_text_comp, histo_text_comp, input_example_comp,upload_another_doc_btn,
271
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
272
 
273
  return qna
 
133
  update_ = {
134
  histo_text_comp: gr.update(visible=True, value=histo_text_),
135
  input_example_comp: gr.update(visible=False,),
136
+ intro_text: gr.update(visible=False),
137
+
138
  }
139
  for i in range(4):
140
  update_[source_text_comp[i]] = gr.update(visible=False)
 
146
  update_ = {
147
  histo_text_comp: gr.update(value=histo_text_),
148
  input_text_comp: gr.update(value=''),
149
+ intro_text: gr.update(visible=False),
150
  }
151
  for i in range(min(len(sources), 3)):
152
  s = sources[i]
 
165
  input_text_comp: gr.update(value=input_example_),
166
  histo_text_comp: gr.update(visible=True, value=histo_text_),
167
  input_example_comp: gr.update(visible=False, value=''),
168
+ intro_text: gr.update(visible=False),
169
  }
170
  for i in range(4):
171
  update_[source_text_comp[i]] = gr.update(visible=False)
 
177
  histo_text_comp: gr.update(value='', visible=False),
178
  input_example_comp: gr.update(value='', visible=True),
179
  upload_another_doc_btn: gr.update(visible=True),
180
+ intro_text: gr.update(visible=False),
181
  }
182
  for i in range(4):
183
  update_[source_text_comp[i]] = gr.update(visible=False, value='hello')
 
255
  input_text_comp \
256
  .submit(input_text_fn1,
257
  inputs=[input_text_comp, histo_text_comp],
258
+ outputs=[intro_text,histo_text_comp, input_example_comp,
259
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])\
260
  .then(input_text_fn2,
261
  inputs=[input_text_comp, histo_text_comp],
262
+ outputs=[intro_text,input_text_comp, histo_text_comp,
263
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
264
  input_example_comp \
265
  .input(input_example_fn,
266
  inputs=[input_example_comp, histo_text_comp],
267
+ outputs=[intro_text,input_text_comp, histo_text_comp, input_example_comp,
268
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])\
269
  .then(input_text_fn2,
270
  inputs=[input_text_comp, histo_text_comp],
271
+ outputs=[intro_text,input_text_comp, histo_text_comp,
272
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
273
  clear_btn.click(clear_fn,
274
  inputs=None,
275
+ outputs=[intro_text,input_text_comp, histo_text_comp, input_example_comp,upload_another_doc_btn,
276
  source_text_comp[0], source_text_comp[1], source_text_comp[2], source_text_comp[3]])
277
 
278
  return qna