Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -196,18 +196,19 @@ def get_streams():
|
|
196 |
|
197 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False)
|
198 |
return jsonify({"ans": stream})
|
|
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
def get_streams():
|
203 |
-
data = request.get_json()
|
204 |
-
degree = data.get('degree')
|
205 |
-
|
206 |
temperature = 0.9
|
207 |
max_new_tokens = 256
|
208 |
top_p = 0.95
|
209 |
repetition_penalty = 1.0
|
210 |
|
|
|
|
|
|
|
|
|
211 |
generate_kwargs = dict(
|
212 |
temperature=temperature,
|
213 |
max_new_tokens=max_new_tokens,
|
@@ -217,11 +218,11 @@ def get_streams():
|
|
217 |
seed=42,
|
218 |
)
|
219 |
prompt = f""" prompt:
|
220 |
-
You need to act like as recommendation engine.
|
221 |
-
|
222 |
-
|
223 |
Note: Output should be list in below format:
|
224 |
-
[
|
225 |
Return only answer not prompt and unnecessary stuff, also dont add any special characters or punctuation marks
|
226 |
"""
|
227 |
formatted_prompt = format_prompt(prompt)
|
@@ -231,6 +232,7 @@ def get_streams():
|
|
231 |
|
232 |
|
233 |
|
|
|
234 |
@app.route('/get_education_profiles', methods=['GET'])
|
235 |
def get_education_profiles():
|
236 |
temperature = 0.9
|
|
|
196 |
|
197 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False)
|
198 |
return jsonify({"ans": stream})
|
199 |
+
|
200 |
|
201 |
+
@app.route('/get_stream_degree', methods=['POST'])
|
202 |
+
def get_certificate():
|
|
|
|
|
|
|
|
|
203 |
temperature = 0.9
|
204 |
max_new_tokens = 256
|
205 |
top_p = 0.95
|
206 |
repetition_penalty = 1.0
|
207 |
|
208 |
+
content = request.json
|
209 |
+
# user_degree = content.get('degree') # Uncomment this line
|
210 |
+
user_stream = content.get('degree')
|
211 |
+
|
212 |
generate_kwargs = dict(
|
213 |
temperature=temperature,
|
214 |
max_new_tokens=max_new_tokens,
|
|
|
218 |
seed=42,
|
219 |
)
|
220 |
prompt = f""" prompt:
|
221 |
+
You need to act like as recommendation engine for streams/branches recommendation for a student. Below are current details.
|
222 |
+
Stream: {user_stream}
|
223 |
+
Based on current details recommend the streams/branches
|
224 |
Note: Output should be list in below format:
|
225 |
+
[course1, course2, course3,...]
|
226 |
Return only answer not prompt and unnecessary stuff, also dont add any special characters or punctuation marks
|
227 |
"""
|
228 |
formatted_prompt = format_prompt(prompt)
|
|
|
232 |
|
233 |
|
234 |
|
235 |
+
|
236 |
@app.route('/get_education_profiles', methods=['GET'])
|
237 |
def get_education_profiles():
|
238 |
temperature = 0.9
|