Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -24,29 +24,14 @@ file_size = os.stat('Phi-3-mini-4k-instruct-q4.gguf')
|
|
24 |
print("model size ====> :", file_size.st_size, "bytes")
|
25 |
|
26 |
|
27 |
-
@app.route('/cv', methods=['POST'])
|
28 |
-
def get_skills():
|
29 |
-
cv_body = request.json.get('cv_body')
|
30 |
|
31 |
-
|
32 |
-
output = llm(
|
33 |
-
f"\n{cv_body}\nCan you list the skills mentioned in the CV?",
|
34 |
-
max_tokens=256, # Generate up to 256 tokens
|
35 |
-
stop=[""],
|
36 |
-
echo=True, # Whether to echo the prompt
|
37 |
-
)
|
38 |
-
|
39 |
-
return jsonify({'skills': output})
|
40 |
-
|
41 |
-
@app.get('/')
|
42 |
-
def health():
|
43 |
-
return jsonify({'status': 'Worked'})
|
44 |
|
45 |
@app.route('/compare', methods=['POST'])
|
46 |
def compare():
|
47 |
data = request.json
|
48 |
|
49 |
-
# Validation
|
50 |
if 'jobs_skills' not in data or 'employee_skills' not in data:
|
51 |
return jsonify({"error": "Missing 'jobs_skills' or 'employee_skills' in request"}), 400
|
52 |
|
@@ -75,4 +60,4 @@ def compare():
|
|
75 |
return jsonify(similarity_scores)
|
76 |
|
77 |
if __name__ == '__main__':
|
78 |
-
app.run()
|
|
|
24 |
print("model size ====> :", file_size.st_size, "bytes")
|
25 |
|
26 |
|
|
|
|
|
|
|
27 |
|
28 |
+
# Assume 'model' is already defined somewhere else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
@app.route('/compare', methods=['POST'])
|
31 |
def compare():
|
32 |
data = request.json
|
33 |
|
34 |
+
# Validation and data extraction
|
35 |
if 'jobs_skills' not in data or 'employee_skills' not in data:
|
36 |
return jsonify({"error": "Missing 'jobs_skills' or 'employee_skills' in request"}), 400
|
37 |
|
|
|
60 |
return jsonify(similarity_scores)
|
61 |
|
62 |
if __name__ == '__main__':
|
63 |
+
app.run(debug=True)
|