garyd1 commited on
Commit
c4f4c38
·
verified ·
1 Parent(s): 912706a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -48,13 +48,13 @@ def generate_question(user_input, resume_embeddings):
48
  # Gradio interface
49
  def mock_interview(audio, pdf):
50
  resume_embeddings = process_resume(pdf)
51
- transcription = stt_model(audio)["text"]
52
- question = generate_question(transcription, resume_embeddings)
53
- return transcription, question
54
 
55
  interface = gr.Interface(
56
  fn=mock_interview,
57
- inputs=[gr.Audio(source="microphone", type="filepath"), gr.File(label="Upload Resume (PDF)")],
58
  outputs=["text", "text"],
59
  title="Mock Interview AI",
60
  description="Upload your resume and answer questions in a mock interview."
 
48
  # Gradio interface
49
  def mock_interview(audio, pdf):
50
  resume_embeddings = process_resume(pdf)
51
+ transcription = stt_model(audio["name"]) # Using Gradio's audio file object
52
+ question = generate_question(transcription["text"], resume_embeddings)
53
+ return transcription["text"], question
54
 
55
  interface = gr.Interface(
56
  fn=mock_interview,
57
+ inputs=[gr.Audio(type="filepath"), gr.File(label="Upload Resume (PDF)")],
58
  outputs=["text", "text"],
59
  title="Mock Interview AI",
60
  description="Upload your resume and answer questions in a mock interview."