Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -168,15 +168,6 @@ async def predict(question_choice, strategy_choice, feedback_level, audio):
|
|
168 |
chat_history.append(("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡", "Transcription complete. Generating feedback. Please continue listening to your oral response while waiting ..."))
|
169 |
yield chat_history, current_audio_output
|
170 |
|
171 |
-
moderation_response = client.moderations.create(input=student_response)
|
172 |
-
flagged = any(result.flagged for result in moderation_response.results)
|
173 |
-
if flagged:
|
174 |
-
moderated_message = "The message has been flagged. Please see your teacher to clarify."
|
175 |
-
questionNo = thinkingframes.questions.index(question_choice) + 1
|
176 |
-
add_submission(int(user_state.value), moderated_message, "", int(0), "", questionNo)
|
177 |
-
yield chat_history, current_audio_output
|
178 |
-
return
|
179 |
-
|
180 |
accumulated_feedback = "" # Variable to store the accumulated feedback
|
181 |
|
182 |
async for feedback_chunk in generate_feedback(int(user_state.value), question_choice, strategy_choice, student_response, feedback_level):
|
@@ -196,6 +187,7 @@ async def predict(question_choice, strategy_choice, feedback_level, audio):
|
|
196 |
logging.error(f"An error occurred: {str(e)}", exc_info=True)
|
197 |
yield [("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡", "An error occurred. Please try again or seek assistance.")], current_audio_output
|
198 |
|
|
|
199 |
with gr.Blocks(title="Oral Coach powered by ZeroGPU⚡ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡ and Meta AI 🦙 (LLama3)", theme=theme, css="footer {visibility: hidden}textbox{resize:none}") as demo:
|
200 |
with gr.Tab("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡"):
|
201 |
gr.Markdown("## Student Information")
|
|
|
168 |
chat_history.append(("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡", "Transcription complete. Generating feedback. Please continue listening to your oral response while waiting ..."))
|
169 |
yield chat_history, current_audio_output
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
accumulated_feedback = "" # Variable to store the accumulated feedback
|
172 |
|
173 |
async for feedback_chunk in generate_feedback(int(user_state.value), question_choice, strategy_choice, student_response, feedback_level):
|
|
|
187 |
logging.error(f"An error occurred: {str(e)}", exc_info=True)
|
188 |
yield [("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡", "An error occurred. Please try again or seek assistance.")], current_audio_output
|
189 |
|
190 |
+
|
191 |
with gr.Blocks(title="Oral Coach powered by ZeroGPU⚡ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡ and Meta AI 🦙 (LLama3)", theme=theme, css="footer {visibility: hidden}textbox{resize:none}") as demo:
|
192 |
with gr.Tab("Oral Coach ⚡ ϞϞ(๑⚈ ․̫ ⚈๑)∩ ⚡"):
|
193 |
gr.Markdown("## Student Information")
|