demetz commited on
Commit
8c25b40
·
verified ·
1 Parent(s): f3e8946

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -251,16 +251,16 @@ with gr.Blocks(css=chat_css) as chatbot:
251
  btn = gr.Button(choice, elem_classes=["alignment-btn"])
252
  buttons.append(btn)
253
 
254
- # Click logic for all alignment buttons
255
  for btn, choice in zip(buttons, alignment_choices):
256
  btn.click(
257
  fn=lambda c=choice: c,
258
  inputs=None,
259
  outputs=selected_alignment
260
  ).then(
261
- None,
262
- None,
263
- None,
264
  _js=f"""
265
  () => {{
266
  document.querySelectorAll('.alignment-btn').forEach(b => b.classList.remove('selected'));
@@ -273,7 +273,6 @@ with gr.Blocks(css=chat_css) as chatbot:
273
  """
274
  )
275
 
276
- # Chat interface
277
  gr.ChatInterface(
278
  fn=respond,
279
  additional_inputs=[character_name, character_class, selected_alignment],
 
251
  btn = gr.Button(choice, elem_classes=["alignment-btn"])
252
  buttons.append(btn)
253
 
254
+ # Alignment button logic
255
  for btn, choice in zip(buttons, alignment_choices):
256
  btn.click(
257
  fn=lambda c=choice: c,
258
  inputs=None,
259
  outputs=selected_alignment
260
  ).then(
261
+ fn=None,
262
+ inputs=None,
263
+ outputs=None,
264
  _js=f"""
265
  () => {{
266
  document.querySelectorAll('.alignment-btn').forEach(b => b.classList.remove('selected'));
 
273
  """
274
  )
275
 
 
276
  gr.ChatInterface(
277
  fn=respond,
278
  additional_inputs=[character_name, character_class, selected_alignment],