QL2023 commited on
Commit
0ab3d37
·
verified ·
1 Parent(s): 9d6dce4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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):
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"
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], 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):
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
  )
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