darshan8950 commited on
Commit
25f7cba
·
verified ·
1 Parent(s): c3ba37f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -2
main.py CHANGED
@@ -9,6 +9,10 @@ llm = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-v0.1-GGUF", mode
9
 
10
  app = Flask(__name__)
11
 
 
 
 
 
12
  @app.route('/')
13
  def home():
14
  return jsonify({"message": "Welcome to the Recommendation API!"})
@@ -44,14 +48,16 @@ def recommendation():
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,...}}
 
9
 
10
  app = Flask(__name__)
11
 
12
+ file_path = "mentor.txt"
13
+ with open(file_path, "r") as file:
14
+ mentors_data = file.read()
15
+
16
  @app.route('/')
17
  def home():
18
  return jsonify({"message": "Welcome to the Recommendation API!"})
 
48
  user_degree = content.get('degree')
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}
56
  Stream: {user_stream}
57
  Current Semester: {user_semester}
58
+ courses opted:{courses}
59
 
60
+ Mentor list= {mentors_data}
61
  Based on above details recommend the mentor that realtes to above details
62
  Note: Output should bevalid json format in below format:
63
  {{"mentor1:ABC,mentor2:DEF,mentor3:XYZ,...}}