IliaLarchenko commited on
Commit
fda8b87
1 Parent(s): d6ee3f8

Fixed send button params

Browse files
Files changed (1) hide show
  1. ui/coding.py +10 -6
ui/coding.py CHANGED
@@ -102,8 +102,8 @@ def get_problem_solving_ui(llm, tts, stt, default_audio_params, audio_output, na
102
  ).success(
103
  fn=llm.init_bot, inputs=[description, interview_type], outputs=[chat_history]
104
  ).success(
105
- fn=lambda: (gr.update(open=True), gr.update(interactive=True), gr.update(interactive=True)),
106
- outputs=[solution_acc, end_btn, audio_input],
107
  )
108
 
109
  end_btn.click(
@@ -111,8 +111,14 @@ def get_problem_solving_ui(llm, tts, stt, default_audio_params, audio_output, na
111
  inputs=[chat],
112
  outputs=[chat],
113
  ).success(fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]).success(
114
- fn=lambda: (gr.update(open=False), gr.update(interactive=False), gr.update(open=False), gr.update(interactive=False)),
115
- outputs=[solution_acc, end_btn, problem_acc, audio_input],
 
 
 
 
 
 
116
  ).success(
117
  fn=llm.end_interview, inputs=[description, chat_history, interview_type], outputs=[feedback]
118
  )
@@ -125,8 +131,6 @@ def get_problem_solving_ui(llm, tts, stt, default_audio_params, audio_output, na
125
  outputs=[chat_history, chat, previous_code],
126
  ).success(
127
  fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
128
- ).success(
129
- fn=lambda: gr.update(interactive=False), outputs=[send_btn]
130
  ).success(
131
  fn=lambda: np.array([], dtype=np.int16), outputs=[audio_buffer]
132
  ).success(
 
102
  ).success(
103
  fn=llm.init_bot, inputs=[description, interview_type], outputs=[chat_history]
104
  ).success(
105
+ fn=lambda: (gr.update(open=True), gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=True)),
106
+ outputs=[solution_acc, end_btn, audio_input, send_btn],
107
  )
108
 
109
  end_btn.click(
 
111
  inputs=[chat],
112
  outputs=[chat],
113
  ).success(fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]).success(
114
+ fn=lambda: (
115
+ gr.update(open=False),
116
+ gr.update(interactive=False),
117
+ gr.update(open=False),
118
+ gr.update(interactive=False),
119
+ gr.update(interactive=False),
120
+ ),
121
+ outputs=[solution_acc, end_btn, problem_acc, audio_input, send_btn],
122
  ).success(
123
  fn=llm.end_interview, inputs=[description, chat_history, interview_type], outputs=[feedback]
124
  )
 
131
  outputs=[chat_history, chat, previous_code],
132
  ).success(
133
  fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
 
 
134
  ).success(
135
  fn=lambda: np.array([], dtype=np.int16), outputs=[audio_buffer]
136
  ).success(