Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -55,13 +55,16 @@ class MockInterview:
|
|
55 |
self.resume_embeddings = process_resume(resume)
|
56 |
self.job_desc_embedding = process_job_description(job_desc)
|
57 |
self.interview_active = True
|
58 |
-
return "Resume and job description processed. Interview is
|
59 |
|
60 |
def conduct_interview(self, audio_file):
|
61 |
if not self.interview_active:
|
62 |
return "Please upload your resume and job description first.", ""
|
63 |
|
64 |
transcription = stt_model(audio_file)["text"] # Transcribe audio
|
|
|
|
|
|
|
65 |
question = generate_question(transcription, self.resume_embeddings)
|
66 |
return transcription, question
|
67 |
|
|
|
55 |
self.resume_embeddings = process_resume(resume)
|
56 |
self.job_desc_embedding = process_job_description(job_desc)
|
57 |
self.interview_active = True
|
58 |
+
return "Resume and job description processed. Interview is ready to start."
|
59 |
|
60 |
def conduct_interview(self, audio_file):
|
61 |
if not self.interview_active:
|
62 |
return "Please upload your resume and job description first.", ""
|
63 |
|
64 |
transcription = stt_model(audio_file)["text"] # Transcribe audio
|
65 |
+
if not transcription.strip():
|
66 |
+
return "No audio detected. Please try again.", ""
|
67 |
+
|
68 |
question = generate_question(transcription, self.resume_embeddings)
|
69 |
return transcription, question
|
70 |
|