Nassira commited on
Commit
88fa0f7
·
verified ·
1 Parent(s): b95a58b

Update cv_analyzer.py

Browse files
Files changed (1) hide show
  1. cv_analyzer.py +6 -3
cv_analyzer.py CHANGED
@@ -22,10 +22,13 @@ def detect_cv_sections_and_score(text):
22
 
23
  response = llm(prompt, max_tokens=500)
24
 
 
 
 
25
  # Extract the JSON part from the response
26
- json_start = response.find('{')
27
- json_end = response.rfind('}') + 1
28
- json_str = response[json_start:json_end]
29
 
30
  try:
31
  detected_sections = json.loads(json_str)
 
22
 
23
  response = llm(prompt, max_tokens=500)
24
 
25
+ # Extract the content from the response dictionary
26
+ response_text = response['choices'][0]['text']
27
+
28
  # Extract the JSON part from the response
29
+ json_start = response_text.find('{')
30
+ json_end = response_text.rfind('}') + 1
31
+ json_str = response_text[json_start:json_end]
32
 
33
  try:
34
  detected_sections = json.loads(json_str)