Spaces:
Sleeping
Sleeping
Commit
·
e227c00
1
Parent(s):
ac13632
replaced then with success
Browse files
app.py
CHANGED
@@ -136,20 +136,22 @@ with gr.Blocks(title="AI Interviewer") as demo:
|
|
136 |
feedback = gr.Markdown()
|
137 |
|
138 |
# Events
|
139 |
-
coding_tab.select(fn=add_interviewer_message(fixed_messages["intro"]), inputs=[chat, started_coding], outputs=[chat]).
|
140 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
141 |
)
|
142 |
|
143 |
-
start_btn.click(fn=add_interviewer_message(fixed_messages["start"]), inputs=[chat], outputs=[chat]).
|
144 |
fn=lambda: True, outputs=[started_coding]
|
145 |
-
).
|
|
|
|
|
146 |
fn=llm.get_problem,
|
147 |
inputs=[requirements, difficulty_select, topic_select],
|
148 |
outputs=[description],
|
149 |
scroll_to_output=True,
|
150 |
-
).
|
151 |
fn=llm.init_bot, inputs=[description], outputs=[chat_history]
|
152 |
-
).
|
153 |
fn=show_solution, outputs=[solution_acc, end_btn, audio_input]
|
154 |
)
|
155 |
|
@@ -157,19 +159,19 @@ with gr.Blocks(title="AI Interviewer") as demo:
|
|
157 |
fn=add_interviewer_message(fixed_messages["end"]),
|
158 |
inputs=[chat],
|
159 |
outputs=[chat],
|
160 |
-
).
|
161 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
162 |
-
).
|
163 |
fn=llm.end_interview, inputs=[description, chat_history], outputs=[feedback]
|
164 |
)
|
165 |
|
166 |
-
audio_input.stop_recording(fn=stt.add_user_message, inputs=[audio_input, chat], outputs=[chat]).
|
167 |
fn=lambda: None, outputs=[audio_input]
|
168 |
-
).
|
169 |
fn=llm.send_request,
|
170 |
inputs=[code, previous_code, chat_history, chat],
|
171 |
outputs=[chat_history, chat, previous_code],
|
172 |
-
).
|
173 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
174 |
)
|
175 |
|
|
|
136 |
feedback = gr.Markdown()
|
137 |
|
138 |
# Events
|
139 |
+
coding_tab.select(fn=add_interviewer_message(fixed_messages["intro"]), inputs=[chat, started_coding], outputs=[chat]).success(
|
140 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
141 |
)
|
142 |
|
143 |
+
start_btn.click(fn=add_interviewer_message(fixed_messages["start"]), inputs=[chat], outputs=[chat]).success(
|
144 |
fn=lambda: True, outputs=[started_coding]
|
145 |
+
).success(fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]).success(
|
146 |
+
fn=hide_settings, outputs=[init_acc, start_btn]
|
147 |
+
).success(
|
148 |
fn=llm.get_problem,
|
149 |
inputs=[requirements, difficulty_select, topic_select],
|
150 |
outputs=[description],
|
151 |
scroll_to_output=True,
|
152 |
+
).success(
|
153 |
fn=llm.init_bot, inputs=[description], outputs=[chat_history]
|
154 |
+
).success(
|
155 |
fn=show_solution, outputs=[solution_acc, end_btn, audio_input]
|
156 |
)
|
157 |
|
|
|
159 |
fn=add_interviewer_message(fixed_messages["end"]),
|
160 |
inputs=[chat],
|
161 |
outputs=[chat],
|
162 |
+
).success(
|
163 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
164 |
+
).success(fn=hide_solution, outputs=[solution_acc, end_btn, problem_acc, audio_input]).success(
|
165 |
fn=llm.end_interview, inputs=[description, chat_history], outputs=[feedback]
|
166 |
)
|
167 |
|
168 |
+
audio_input.stop_recording(fn=stt.add_user_message, inputs=[audio_input, chat], outputs=[chat]).success(
|
169 |
fn=lambda: None, outputs=[audio_input]
|
170 |
+
).success(
|
171 |
fn=llm.send_request,
|
172 |
inputs=[code, previous_code, chat_history, chat],
|
173 |
outputs=[chat_history, chat, previous_code],
|
174 |
+
).success(
|
175 |
fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
176 |
)
|
177 |
|