Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,20 +97,44 @@ def finalize_interview():
|
|
| 97 |
message, audio = mock_interview.end_interview()
|
| 98 |
return audio
|
| 99 |
|
|
|
|
| 100 |
interface = gr.Blocks()
|
| 101 |
|
| 102 |
with interface:
|
| 103 |
-
gr.Markdown("
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|
| 116 |
interface.launch()
|
|
|
|
| 97 |
message, audio = mock_interview.end_interview()
|
| 98 |
return audio
|
| 99 |
|
| 100 |
+
# Gradio Interface
|
| 101 |
interface = gr.Blocks()
|
| 102 |
|
| 103 |
with interface:
|
| 104 |
+
gr.Markdown("""
|
| 105 |
+
## π§βπΌ Mock Interview AI
|
| 106 |
+
Welcome to the Mock Interview simulator! Follow these steps:
|
| 107 |
+
1. Upload your resume (PDF format).
|
| 108 |
+
2. Paste the job description.
|
| 109 |
+
3. Press "Submit" to start the interview.
|
| 110 |
+
The system will ask questions and listen to your responses automatically. Good luck!
|
| 111 |
+
""")
|
| 112 |
+
|
| 113 |
+
with gr.Row():
|
| 114 |
+
with gr.Column(scale=2):
|
| 115 |
+
gr.Markdown("### Upload Details")
|
| 116 |
+
resume_input = gr.File(label="π Upload Resume (PDF)")
|
| 117 |
+
job_desc_input = gr.Textbox(
|
| 118 |
+
label="π Paste Job Description",
|
| 119 |
+
placeholder="Paste the job description here...",
|
| 120 |
+
lines=5,
|
| 121 |
+
)
|
| 122 |
+
submit_button = gr.Button("π Submit & Start Interview")
|
| 123 |
+
|
| 124 |
+
with gr.Column(scale=1):
|
| 125 |
+
gr.Markdown("### Interview Progress")
|
| 126 |
+
question_audio_output = gr.Audio(label="π€ Question Audio")
|
| 127 |
+
transcription_output = gr.Textbox(label="ποΈ Your Transcription", lines=3)
|
| 128 |
+
|
| 129 |
+
gr.Markdown("### Respond to Questions")
|
| 130 |
+
audio_input = gr.Audio(source="microphone", type="filepath", label="ποΈ Speak Your Answer")
|
| 131 |
+
|
| 132 |
+
submit_button.click(
|
| 133 |
+
start_interview, inputs=[resume_input, job_desc_input], outputs=[question_audio_output]
|
| 134 |
+
)
|
| 135 |
+
audio_input.change(
|
| 136 |
+
process_response, inputs=[audio_input], outputs=[transcription_output, question_audio_output]
|
| 137 |
+
)
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
interface.launch()
|