simonraj commited on
Commit
a9269e0
·
1 Parent(s): 00a57bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -15,11 +15,14 @@ def image_to_base64(img_path):
15
  img_base64 = image_to_base64("RadinMasSBC.JPG")
16
  img_html = f'<img src="data:image/jpg;base64,{img_base64}" alt="SBC6" width="300" style="display: block; margin: auto;"/>'
17
 
18
- def predict(question_choice, audio):
19
  # Transcribe the audio using Whisper
20
  with open(audio, "rb") as audio_file:
21
  transcript = openai.Audio.transcribe("whisper-1", audio_file)
22
  message = transcript["text"] # This is the transcribed message from the audio input
 
 
 
23
 
24
  # Determine question number based on question_choice
25
  question_number = RadinMas.questions.index(question_choice) + 1 # New line
 
15
  img_base64 = image_to_base64("RadinMasSBC.JPG")
16
  img_html = f'<img src="data:image/jpg;base64,{img_base64}" alt="SBC6" width="300" style="display: block; margin: auto;"/>'
17
 
18
+ def predict(question_choice, feedback_level, audio):
19
  # Transcribe the audio using Whisper
20
  with open(audio, "rb") as audio_file:
21
  transcript = openai.Audio.transcribe("whisper-1", audio_file)
22
  message = transcript["text"] # This is the transcribed message from the audio input
23
+
24
+ # Generate the prompt based on the feedback level
25
+ feedback_prompt = RadinMas.generate_prompt(feedback_level)
26
 
27
  # Determine question number based on question_choice
28
  question_number = RadinMas.questions.index(question_choice) + 1 # New line