Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,11 +32,11 @@ def generate_ai_text(prompt,temperature):
|
|
| 32 |
text = response["choices"][0]["message"]["content"]
|
| 33 |
return text
|
| 34 |
|
| 35 |
-
def generate_prompt(ini_prompt,no_login,low_activity,repeated_course,low_marks,WAM,forum_count):
|
| 36 |
|
| 37 |
body = ini_prompt
|
| 38 |
|
| 39 |
-
data = f"Here are the indicators for the student:\n No Moodle Login: {no_login}\n Low Moodle Activity: {low_activity}\n Student is repeating this course: {repeated_course}\n Student has low marks: {low_marks}\n Student's WAM across all courses: {WAM}\n Student's forum activity: {forum_count}\n"
|
| 40 |
|
| 41 |
text = body + "\n\n" + data
|
| 42 |
|
|
@@ -113,7 +113,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 113 |
)
|
| 114 |
text_ai_button = gr.Button("Generate Text")
|
| 115 |
|
| 116 |
-
prompt_button.click(generate_prompt, inputs=[ini_prompt,no_login,low_activity,repeated_course,low_marks,WAM,forum_count], outputs=[revised_prompt])
|
| 117 |
text_ai_button.click(generate_ai_text, inputs=[revised_prompt,temperature], outputs=[genai_text], api_name="gen")
|
| 118 |
|
| 119 |
|
|
|
|
| 32 |
text = response["choices"][0]["message"]["content"]
|
| 33 |
return text
|
| 34 |
|
| 35 |
+
def generate_prompt(ini_prompt,no_login,low_activity,repeated_course,low_marks,WAM,forum_count,pre_fail,this_fail):
|
| 36 |
|
| 37 |
body = ini_prompt
|
| 38 |
|
| 39 |
+
data = f"Here are the indicators for the student:\n No Moodle Login: {no_login}\n Low Moodle Activity: {low_activity}\n Student is repeating this course: {repeated_course}\n Student has low marks: {low_marks}\n Student's WAM across all courses: {WAM}\n Student's forum activity: {forum_count}\n Count of student's previous fail of all courses: {pre_fail}\n Count of student's previous fail of this courses: {this_fail_fail}\n "
|
| 40 |
|
| 41 |
text = body + "\n\n" + data
|
| 42 |
|
|
|
|
| 113 |
)
|
| 114 |
text_ai_button = gr.Button("Generate Text")
|
| 115 |
|
| 116 |
+
prompt_button.click(generate_prompt, inputs=[ini_prompt,no_login,low_activity,repeated_course,low_marks,WAM,forum_count,pre_fail,this_fail], outputs=[revised_prompt])
|
| 117 |
text_ai_button.click(generate_ai_text, inputs=[revised_prompt,temperature], outputs=[genai_text], api_name="gen")
|
| 118 |
|
| 119 |
|