Spaces:
Sleeping
Sleeping
Update src/services/cv_service.py
Browse files
src/services/cv_service.py
CHANGED
|
@@ -14,6 +14,7 @@ logger = logging.getLogger(__name__)
|
|
| 14 |
async def parse_cv(pdf_path: str) -> Dict[str, Any]:
|
| 15 |
orchestrator = CVAgentOrchestrator(llm=None)
|
| 16 |
scoring_agent = SimpleScoringAgent()
|
|
|
|
| 17 |
cv_text = load_pdf(pdf_path)
|
| 18 |
if not cv_text or not cv_text.strip():
|
| 19 |
return _create_fallback_data()
|
|
@@ -48,6 +49,11 @@ async def parse_cv(pdf_path: str) -> Dict[str, Any]:
|
|
| 48 |
logger.info("Analyse enrichie ajoutée avec succès")
|
| 49 |
else:
|
| 50 |
logger.warning("Aucune analyse enrichie générée")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
return cv_data
|
| 52 |
|
| 53 |
def _create_fallback_data() -> Dict[str, Any]:
|
|
|
|
| 14 |
async def parse_cv(pdf_path: str) -> Dict[str, Any]:
|
| 15 |
orchestrator = CVAgentOrchestrator(llm=None)
|
| 16 |
scoring_agent = SimpleScoringAgent()
|
| 17 |
+
start_time = datetime.now()
|
| 18 |
cv_text = load_pdf(pdf_path)
|
| 19 |
if not cv_text or not cv_text.strip():
|
| 20 |
return _create_fallback_data()
|
|
|
|
| 49 |
logger.info("Analyse enrichie ajoutée avec succès")
|
| 50 |
else:
|
| 51 |
logger.warning("Aucune analyse enrichie générée")
|
| 52 |
+
end_time = datetime.now()
|
| 53 |
+
duration = (end_time - start_time).total_seconds()
|
| 54 |
+
cv_data["execution_time"] = duration
|
| 55 |
+
|
| 56 |
+
logger.info(f"CV parsed in {duration:.2f} seconds")
|
| 57 |
return cv_data
|
| 58 |
|
| 59 |
def _create_fallback_data() -> Dict[str, Any]:
|