Neurolingua
commited on
Update teacher_function.py
Browse files- teacher_function.py +4 -4
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)
|
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
|
69 |
|
70 |
def generate_student_report(name, age, cgpa, course, assigned_test, ai_test, interests, difficulty, courses_taken):
|
71 |
prompt = f"""
|
@@ -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
|
130 |
|
131 |
def generate_timetable_weak(clustered_subjects, hours_per_day):
|
132 |
prompt = (
|
@@ -145,5 +145,5 @@ 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
|
149 |
|
|
|
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 |
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"""
|
|
|
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 |
):
|
146 |
if chunk.choices[0].delta.content:
|
147 |
response += chunk.choices[0].delta.content
|
148 |
+
return response.replace('\n','<br>')
|
149 |
|