darshan8950 commited on
Commit
24c6700
·
verified ·
1 Parent(s): 7497699

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +26 -1
main.py CHANGED
@@ -20,7 +20,7 @@ def recommendation():
20
  user_stream = content.get('stream')
21
  user_semester = content.get('semester')
22
  prompt = """
23
- You need to act like as recommendataion engine for course recommendation based on below details.
24
 
25
  Degree: {user_degree}
26
  Stream: {user_stream}
@@ -37,5 +37,30 @@ def recommendation():
37
  prompt = f"{prefix}{user.replace('{prompt}', prompt)}{suffix}"
38
  return jsonify({"ans":llm(prompt)})
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  if __name__ == '__main__':
41
  app.run(debug=True)
 
20
  user_stream = content.get('stream')
21
  user_semester = content.get('semester')
22
  prompt = """
23
+ You need to act like as recommendataion engine for course recommendation for student based on below details.
24
 
25
  Degree: {user_degree}
26
  Stream: {user_stream}
 
37
  prompt = f"{prefix}{user.replace('{prompt}', prompt)}{suffix}"
38
  return jsonify({"ans":llm(prompt)})
39
 
40
+
41
+ @app.route('/get_mentor', methods=['POST'])
42
+ def recommendation():
43
+ content = request.json
44
+ user_degree = content.get('degree')
45
+ user_stream = content.get('stream')
46
+ user_semester = content.get('semester')
47
+ prompt = """
48
+ 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.
49
+
50
+ Degree: {user_degree}
51
+ Stream: {user_stream}
52
+ Current Semester: {user_semester}
53
+
54
+
55
+ Based on above details recommend the mentor that realtes to above details
56
+ Note: Output should bevalid json format in below format:
57
+ {{"mentor1:ABC,mentor2:DEF,mentor3:XYZ,...}}
58
+
59
+ """
60
+ suffix="[/INST]"
61
+ prefix="[INST] <<SYS>> You are a helpful assistant <</SYS>>"
62
+ prompt = f"{prefix}{user.replace('{prompt}', prompt)}{suffix}"
63
+ return jsonify({"ans":llm(prompt)})
64
+
65
  if __name__ == '__main__':
66
  app.run(debug=True)