Spaces:
Sleeping
Sleeping
Commit
·
b6e8571
1
Parent(s):
cd1897f
Improved coding area interface
Browse files- ui/coding.py +14 -8
ui/coding.py
CHANGED
|
@@ -50,23 +50,28 @@ def get_problem_solving_ui(llm, tts, stt, default_audio_params, audio_output, na
|
|
| 50 |
language="python",
|
| 51 |
lines=46,
|
| 52 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
else:
|
| 54 |
-
code = gr.
|
| 55 |
label="Please write any notes for your solution here.",
|
|
|
|
| 56 |
lines=46,
|
| 57 |
-
max_lines=46,
|
| 58 |
-
show_label=False,
|
| 59 |
)
|
| 60 |
with gr.Column(scale=1):
|
| 61 |
end_btn = gr.Button("Finish the interview", interactive=False)
|
| 62 |
chat = gr.Chatbot(label="Chat", show_label=False, show_share_button=False)
|
| 63 |
message = gr.Textbox(
|
| 64 |
label="Message",
|
| 65 |
-
placeholder="Your message will appear here",
|
| 66 |
show_label=False,
|
| 67 |
lines=3,
|
| 68 |
max_lines=3,
|
| 69 |
-
interactive=
|
|
|
|
| 70 |
)
|
| 71 |
send_btn = gr.Button("Send", interactive=False)
|
| 72 |
audio_input = gr.Audio(interactive=False, **default_audio_params)
|
|
@@ -133,8 +138,9 @@ def get_problem_solving_ui(llm, tts, stt, default_audio_params, audio_output, na
|
|
| 133 |
fn=lambda: gr.update(interactive=True), outputs=[send_btn]
|
| 134 |
).success(fn=lambda: None, outputs=[audio_input])
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
|
|
|
| 139 |
|
| 140 |
return problem_tab
|
|
|
|
| 50 |
language="python",
|
| 51 |
lines=46,
|
| 52 |
)
|
| 53 |
+
elif interview_type.value == "sql":
|
| 54 |
+
code = gr.Code(
|
| 55 |
+
label="Please write your query here.",
|
| 56 |
+
language="sql",
|
| 57 |
+
lines=46,
|
| 58 |
+
)
|
| 59 |
else:
|
| 60 |
+
code = gr.Code(
|
| 61 |
label="Please write any notes for your solution here.",
|
| 62 |
+
language=None,
|
| 63 |
lines=46,
|
|
|
|
|
|
|
| 64 |
)
|
| 65 |
with gr.Column(scale=1):
|
| 66 |
end_btn = gr.Button("Finish the interview", interactive=False)
|
| 67 |
chat = gr.Chatbot(label="Chat", show_label=False, show_share_button=False)
|
| 68 |
message = gr.Textbox(
|
| 69 |
label="Message",
|
|
|
|
| 70 |
show_label=False,
|
| 71 |
lines=3,
|
| 72 |
max_lines=3,
|
| 73 |
+
interactive=True,
|
| 74 |
+
container=False,
|
| 75 |
)
|
| 76 |
send_btn = gr.Button("Send", interactive=False)
|
| 77 |
audio_input = gr.Audio(interactive=False, **default_audio_params)
|
|
|
|
| 138 |
fn=lambda: gr.update(interactive=True), outputs=[send_btn]
|
| 139 |
).success(fn=lambda: None, outputs=[audio_input])
|
| 140 |
|
| 141 |
+
# TODO: add proper messages and clean up when changing the interview type
|
| 142 |
+
# problem_tab.select(fn=add_interviewer_message(fixed_messages["intro"]), inputs=[chat, started_coding], outputs=[chat]).success(
|
| 143 |
+
# fn=tts.read_last_message, inputs=[chat], outputs=[audio_output]
|
| 144 |
+
# )
|
| 145 |
|
| 146 |
return problem_tab
|