Neurolingua commited on
Commit
0007861
1 Parent(s): 2134402

Update teacher_function.py

Browse files
Files changed (1) hide show
  1. teacher_function.py +5 -6
teacher_function.py CHANGED
@@ -30,7 +30,7 @@ def generate_questions_from_text(text, no_of_questions, marks_per_part, no_parts
30
  if chunk.choices[0].delta.content:
31
  questions.append(chunk.choices[0].delta.content)
32
 
33
- return "".join(questions).replace('\n','<br>')
34
 
35
  def extract_text_from_image(image_path):
36
  img = cv2.imread(image_path)
@@ -65,7 +65,7 @@ Note that you should not display total marks"""
65
  if chunk.choices[0].delta.content:
66
  response_content += chunk.choices[0].delta.content
67
 
68
- return response_content.replace('\n','<br>')
69
 
70
  def generate_student_report(name, age, cgpa, course, assigned_test, ai_test, interests, difficulty, courses_taken):
71
  prompt = f"""
@@ -94,7 +94,7 @@ def generate_student_report(name, age, cgpa, course, assigned_test, ai_test, int
94
  0].message else "No report generated."
95
  print(report)
96
 
97
- return report.replace('\n','<br>')
98
  def generate_timetable_module(data,hours_per_day,days_per_week,semester_end_date,subjects):
99
  response = AI71(AI71_API_KEY).chat.completions.create(
100
  model="tiiuae/falcon-180B-chat",
@@ -126,7 +126,7 @@ def cluster_topics(academic_topics):
126
  ):
127
  if chunk.choices[0].delta.content:
128
  response += chunk.choices[0].delta.content
129
- return response.replace('\n','<br>')
130
 
131
  def generate_timetable_weak(clustered_subjects, hours_per_day):
132
  prompt = (
@@ -145,5 +145,4 @@ def generate_timetable_weak(clustered_subjects, hours_per_day):
145
  ):
146
  if chunk.choices[0].delta.content:
147
  response += chunk.choices[0].delta.content
148
- return response.replace('\n','<br>')
149
-
 
30
  if chunk.choices[0].delta.content:
31
  questions.append(chunk.choices[0].delta.content)
32
 
33
+ return "".join(questions)
34
 
35
  def extract_text_from_image(image_path):
36
  img = cv2.imread(image_path)
 
65
  if chunk.choices[0].delta.content:
66
  response_content += chunk.choices[0].delta.content
67
 
68
+ return response_content
69
 
70
  def generate_student_report(name, age, cgpa, course, assigned_test, ai_test, interests, difficulty, courses_taken):
71
  prompt = f"""
 
94
  0].message else "No report generated."
95
  print(report)
96
 
97
+ return report
98
  def generate_timetable_module(data,hours_per_day,days_per_week,semester_end_date,subjects):
99
  response = AI71(AI71_API_KEY).chat.completions.create(
100
  model="tiiuae/falcon-180B-chat",
 
126
  ):
127
  if chunk.choices[0].delta.content:
128
  response += chunk.choices[0].delta.content
129
+ return response
130
 
131
  def generate_timetable_weak(clustered_subjects, hours_per_day):
132
  prompt = (
 
145
  ):
146
  if chunk.choices[0].delta.content:
147
  response += chunk.choices[0].delta.content
148
+ return response