darshan8950 commited on
Commit
c34d039
·
verified ·
1 Parent(s): ef1e39e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -5
main.py CHANGED
@@ -23,7 +23,7 @@ def recommendation():
23
  user_degree = content.get('degree')
24
  user_stream = content.get('stream')
25
  user_semester = content.get('semester')
26
- prompt = """
27
  You need to act like as recommendataion engine for course recommendation for student based on below details.
28
 
29
  Degree: {user_degree}
@@ -38,7 +38,7 @@ def recommendation():
38
  """
39
  suffix="[/INST]"
40
  prefix="[INST] <<SYS>> You are a helpful assistant <</SYS>>"
41
- prompt = f"{prefix}{user.replace('{prompt}', prompt)}{suffix}"
42
  return jsonify({"ans":llm(prompt)})
43
 
44
 
@@ -49,7 +49,7 @@ def mentor():
49
  user_stream = content.get('stream')
50
  user_semester = content.get('semester')
51
  courses = content.get('courses')
52
- prompt = f"""
53
  You need to act like as recommendataion engine for mentor recommendation for student based on below details also the list of mentors with their experience is attached.
54
 
55
  Degree: {user_degree}
@@ -61,11 +61,10 @@ def mentor():
61
  Based on above details recommend the mentor that realtes to above details
62
  Note: Output should be valid json format in below format:
63
  {{"mentor1:ABC,mentor2:DEF,mentor3:XYZ,...}}
64
-
65
  """
66
  suffix="[/INST]"
67
  prefix="[INST] <<SYS>> You are a helpful assistant <</SYS>>"
68
- prompt = f"{prefix}{user.replace('{prompt}', prompt)}{suffix}"
69
  return jsonify({"ans":llm(prompt)})
70
 
71
  if __name__ == '__main__':
 
23
  user_degree = content.get('degree')
24
  user_stream = content.get('stream')
25
  user_semester = content.get('semester')
26
+ prompt = """ prompt:
27
  You need to act like as recommendataion engine for course recommendation for student based on below details.
28
 
29
  Degree: {user_degree}
 
38
  """
39
  suffix="[/INST]"
40
  prefix="[INST] <<SYS>> You are a helpful assistant <</SYS>>"
41
+ prompt = f"{prefix}{prompt}{suffix}"
42
  return jsonify({"ans":llm(prompt)})
43
 
44
 
 
49
  user_stream = content.get('stream')
50
  user_semester = content.get('semester')
51
  courses = content.get('courses')
52
+ prompt = f""" prompt:
53
  You need to act like as recommendataion engine for mentor recommendation for student based on below details also the list of mentors with their experience is attached.
54
 
55
  Degree: {user_degree}
 
61
  Based on above details recommend the mentor that realtes to above details
62
  Note: Output should be valid json format in below format:
63
  {{"mentor1:ABC,mentor2:DEF,mentor3:XYZ,...}}
 
64
  """
65
  suffix="[/INST]"
66
  prefix="[INST] <<SYS>> You are a helpful assistant <</SYS>>"
67
+ prompt = f"{prefix}{prompt}{suffix}"
68
  return jsonify({"ans":llm(prompt)})
69
 
70
  if __name__ == '__main__':