Eng-Musa commited on
Commit
8c1c745
·
1 Parent(s): 764f46a

utc time and requirements dependencies update

Browse files
Files changed (3) hide show
  1. __pycache__/main.cpython-312.pyc +0 -0
  2. main.py +4 -3
  3. requirements.txt +5 -1
__pycache__/main.cpython-312.pyc CHANGED
Binary files a/__pycache__/main.cpython-312.pyc and b/__pycache__/main.cpython-312.pyc differ
 
main.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  import tempfile
3
  from typing import Any, Optional
4
 
5
- from datetime import datetime
6
  from fastapi import FastAPI, UploadFile, File
7
  from fastapi.responses import JSONResponse
8
  from pydantic import BaseModel
@@ -42,7 +42,7 @@ async def process_cv(file: UploadFile = File(...)):
42
 
43
  tmp_path = None
44
  try:
45
- start_time = datetime.now().isoformat()
46
  file_bytes = await file.read()
47
 
48
  suffix = Path(file.filename).suffix.lower()
@@ -51,11 +51,12 @@ async def process_cv(file: UploadFile = File(...)):
51
  tmp_path = Path(tmp.name)
52
 
53
  result = converter.convert(tmp_path)
 
54
 
55
  if not result.success:
56
  return APIResponse(message=result.error, statusCode=422)
57
 
58
- end_time = datetime.now().isoformat()
59
 
60
  return APIResponse(
61
  message="CV processed successfully",
 
2
  import tempfile
3
  from typing import Any, Optional
4
 
5
+ from datetime import datetime, timezone
6
  from fastapi import FastAPI, UploadFile, File
7
  from fastapi.responses import JSONResponse
8
  from pydantic import BaseModel
 
42
 
43
  tmp_path = None
44
  try:
45
+ start_time = datetime.now(timezone.utc).isoformat()
46
  file_bytes = await file.read()
47
 
48
  suffix = Path(file.filename).suffix.lower()
 
51
  tmp_path = Path(tmp.name)
52
 
53
  result = converter.convert(tmp_path)
54
+ end_time = datetime.now(timezone.utc).isoformat()
55
 
56
  if not result.success:
57
  return APIResponse(message=result.error, statusCode=422)
58
 
59
+ end_time = datetime.now(timezone.utc).isoformat()
60
 
61
  return APIResponse(
62
  message="CV processed successfully",
requirements.txt CHANGED
@@ -11,7 +11,11 @@ pdfplumber
11
  python-docx
12
  marker-pdf
13
 
 
 
 
 
14
  # AI / ML Models
15
  transformers
16
  accelerate
17
- torch
 
11
  python-docx
12
  marker-pdf
13
 
14
+ # Pandoc conversion layer
15
+ pypandoc
16
+ pandoc
17
+
18
  # AI / ML Models
19
  transformers
20
  accelerate
21
+ torch