Swapnil-101 commited on
Commit
0a134b5
·
verified ·
1 Parent(s): fdce613

new chnages done

Browse files
Files changed (1) hide show
  1. main.py +5 -7
main.py CHANGED
@@ -68,18 +68,16 @@ def ai_mentor():
68
  return jsonify({"message": f"Failed to process request: {str(e)}"}), 500
69
 
70
 
71
- @app.route('/get_course', methods=['GET'])
72
  def get_course():
73
  temperature = 0.9
74
  max_new_tokens = 256
75
  top_p = 0.95
76
  repetition_penalty = 1.0
77
 
78
-
79
  content = request.json
80
- user_degree = content.get('degree')
81
  user_stream = content.get('stream')
82
- #user_semester = content.get('semester')
83
 
84
  generate_kwargs = dict(
85
  temperature=temperature,
@@ -104,7 +102,7 @@ def get_course():
104
  return jsonify({"ans": stream})
105
 
106
 
107
- @app.route('/get_mentor', methods=['GET'])
108
  def get_mentor():
109
  temperature = 0.9
110
  max_new_tokens = 256
@@ -112,9 +110,8 @@ def get_mentor():
112
  repetition_penalty = 1.0
113
 
114
  content = request.json
115
- user_degree = content.get('degree')
116
  user_stream = content.get('stream')
117
- #user_semester = content.get('semester')
118
  courses = content.get('courses')
119
 
120
  session = Session()
@@ -159,6 +156,7 @@ def get_mentor():
159
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False)
160
  return jsonify({"ans": stream})
161
 
 
162
  @app.route('/get_streams', methods=['GET'])
163
  def get_streams():
164
  temperature = 0.9
 
68
  return jsonify({"message": f"Failed to process request: {str(e)}"}), 500
69
 
70
 
71
+ @app.route('/get_course', methods=['POST'])
72
  def get_course():
73
  temperature = 0.9
74
  max_new_tokens = 256
75
  top_p = 0.95
76
  repetition_penalty = 1.0
77
 
 
78
  content = request.json
79
+ # user_degree = content.get('degree') # Uncomment this line
80
  user_stream = content.get('stream')
 
81
 
82
  generate_kwargs = dict(
83
  temperature=temperature,
 
102
  return jsonify({"ans": stream})
103
 
104
 
105
+ @app.route('/get_mentor', methods=['POST'])
106
  def get_mentor():
107
  temperature = 0.9
108
  max_new_tokens = 256
 
110
  repetition_penalty = 1.0
111
 
112
  content = request.json
113
+ # user_degree = content.get('degree') # Uncomment this line
114
  user_stream = content.get('stream')
 
115
  courses = content.get('courses')
116
 
117
  session = Session()
 
156
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False)
157
  return jsonify({"ans": stream})
158
 
159
+
160
  @app.route('/get_streams', methods=['GET'])
161
  def get_streams():
162
  temperature = 0.9