hudsongouge commited on
Commit
ef7c422
·
1 Parent(s): adf0368

Update space

Browse files
app.py CHANGED
@@ -199,19 +199,24 @@ with gr.Blocks() as demo:
199
  is_chat = mode == "Chat"
200
  return (
201
  gr.update(visible=is_chat), # chatbot
202
- gr.update(visible=is_chat), # chat_input row
203
  gr.update(visible=not is_chat), # completion_input
204
  gr.update(visible=not is_chat), # completion_output
205
  gr.update(visible=is_chat), # user_role_box
206
  gr.update(visible=is_chat), # assistant_role_box
207
  )
208
 
 
 
 
 
 
209
  mode_selector.change(
210
  update_mode,
211
  [mode_selector],
212
  [
213
  chatbot,
214
- chat_input.parent,
215
  completion_input,
216
  completion_output,
217
  user_role_box,
@@ -219,6 +224,17 @@ with gr.Blocks() as demo:
219
  ],
220
  )
221
 
 
 
 
 
 
 
 
 
 
 
 
222
  # Event Handlers
223
  chat_inputs = [
224
  chat_input,
 
199
  is_chat = mode == "Chat"
200
  return (
201
  gr.update(visible=is_chat), # chatbot
202
+ gr.update(), # chat_input row - removed visible parameter
203
  gr.update(visible=not is_chat), # completion_input
204
  gr.update(visible=not is_chat), # completion_output
205
  gr.update(visible=is_chat), # user_role_box
206
  gr.update(visible=is_chat), # assistant_role_box
207
  )
208
 
209
+ # Create a dummy component to replace chat_input.parent which is causing the Form visibility issue
210
+ chat_input_row_visibility = gr.Checkbox(
211
+ visible=False, value=True, label="Chat Input Row Visibility"
212
+ )
213
+
214
  mode_selector.change(
215
  update_mode,
216
  [mode_selector],
217
  [
218
  chatbot,
219
+ chat_input_row_visibility, # Replaced chat_input.parent with dummy component
220
  completion_input,
221
  completion_output,
222
  user_role_box,
 
224
  ],
225
  )
226
 
227
+ # Add a separate event handler to show/hide the chat input row
228
+ def toggle_chat_input_visibility(mode):
229
+ is_chat = mode == "Chat"
230
+ return gr.update(visible=is_chat)
231
+
232
+ mode_selector.change(
233
+ toggle_chat_input_visibility,
234
+ [mode_selector],
235
+ [chat_input.parent],
236
+ )
237
+
238
  # Event Handlers
239
  chat_inputs = [
240
  chat_input,
inference/__pycache__/model.cpython-312.pyc CHANGED
Binary files a/inference/__pycache__/model.cpython-312.pyc and b/inference/__pycache__/model.cpython-312.pyc differ
 
inference/__pycache__/onnx_inference.cpython-312.pyc CHANGED
Binary files a/inference/__pycache__/onnx_inference.cpython-312.pyc and b/inference/__pycache__/onnx_inference.cpython-312.pyc differ
 
inference/__pycache__/optimized_diffattn.cpython-312.pyc CHANGED
Binary files a/inference/__pycache__/optimized_diffattn.cpython-312.pyc and b/inference/__pycache__/optimized_diffattn.cpython-312.pyc differ
 
inference/__pycache__/rotary.cpython-312.pyc CHANGED
Binary files a/inference/__pycache__/rotary.cpython-312.pyc and b/inference/__pycache__/rotary.cpython-312.pyc differ
 
requirements.txt CHANGED
@@ -1 +1,2 @@
1
  torch>=2.2.0
 
 
1
  torch>=2.2.0
2
+ onnxruntime>=1.16.0