Update app.py
Browse files52 unmodified lines53545556575859606162636465666710 unmodified lines7879808182838452 unmodified linestime.sleep(3) # wait for 3 seconds before retryingelse:print("Failed to transcribe audio after multiple attempts")####################################Ask OpenAI to provide feedback on audio responsewith open("Format_Library/FrenchTutor.txt", "r") as f:role = f.read()print(audio_transcript.text+"\n\n")print(role)messages = [{"role": "system", "content": role},{"role": "user", "content": audio_transcript.text }10 unmodified linesq_type = gr.Radio(["Simple","Moyenne","Difficile"], show_label=False, visible=False)txt = gr.Textbox(label="Question")btn = gr.Button(value="Generate Question")recorder = gr.Audio(sources=["upload","microphone"],type="filepath",format="mp3")txt_2 = gr.Textbox(value="", label="Suggestions")btn.click(generate_question, inputs=[q_type], outputs=[txt])52 unmodified lines53545556575859606162636465666710 unmodified lines7879808182838452 unmodified linestime.sleep(3) # wait for 3 seconds before retryingelse:print("Failed to transcribe audio after multiple attempts")print(audio_transcript.text+"\n\n")####################################Ask OpenAI to provide feedback on audio responsewith open("Format_Library/FrenchTutor.txt", "r") as f:role = f.read()##print(role)messages = [{"role": "system", "content": role},{"role": "user", "content": audio_transcript.text }10 unmodified linesq_type = gr.Radio(["Simple","Moyenne","Difficile"], show_label=False, visible=False)txt = gr.Textbox(label="Question")btn = gr.Button(value="Generate Question")recorder = gr.Audio(sources=["microphone"],type="filepath",format="mp3",interactive=False,)txt_2 = gr.Textbox(value="", label="Suggestions")btn.click(generate_question, inputs=[q_type], outputs=[txt])
app.py+4-4