Skip to content

Commit

Permalink
Fix ray version
Browse files Browse the repository at this point in the history
  • Loading branch information
VikParuchuri committed Jan 3, 2024
1 parent 18987bc commit fd261fb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 37 deletions.
1 change: 0 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def main():
num_gpus=1 if settings.CUDA else 0,
storage=settings.RAY_CACHE_PATH,
_temp_dir=settings.RAY_CACHE_PATH,
dashboard_host=settings.RAY_DASHBOARD_HOST,
log_to_driver=settings.DEBUG
)

Expand Down
3 changes: 1 addition & 2 deletions marker/debug/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ def dump_equation_debug_data(doc, images, converted_spans):
assert len(converted_spans) == len(images)

data_lines = []
for idx, (image, converted_span) in enumerate(zip(images, converted_spans)):
for idx, (pil_image, converted_span) in enumerate(zip(images, converted_spans)):
if converted_span is None:
continue
# Image is a BytesIO object
pil_image = Image.open(image)
img_bytes = io.BytesIO()
pil_image.save(img_bytes, format="WEBP", lossless=True)
b64_image = base64.b64encode(img_bytes.getvalue()).decode("utf-8")
Expand Down
3 changes: 1 addition & 2 deletions marker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def TORCH_DEVICE_MODEL(self) -> str:
TEXIFY_MODEL_MAX: int = 384 # Max inference length for texify
TEXIFY_TOKEN_BUFFER: int = 256 # Number of tokens to buffer above max for texify
TEXIFY_DPI: int = 96 # DPI to render images at
TEXIFY_BATCH_SIZE: int = 1 if TORCH_DEVICE_MODEL == "cpu" else 6 # Batch size for texify, don't batch on cpu
TEXIFY_BATCH_SIZE: int = 2 if TORCH_DEVICE_MODEL == "cpu" else 6 # Batch size for texify, lower on cpu due to float32
TEXIFY_MODEL_NAME: str = "vikp/texify"

# Layout model
Expand All @@ -102,7 +102,6 @@ def TORCH_DEVICE_MODEL(self) -> str:

# Ray
RAY_CACHE_PATH: Optional[str] = None # Where to save ray cache
RAY_DASHBOARD_HOST: str = "127.0.0.1"
RAY_CORES_PER_WORKER: int = 1 # How many cpu cores to allocate per worker

# Debug
Expand Down
57 changes: 28 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ PyMuPDF = "^1.23.5"
pymupdf-fonts = "^1.0.5"
pydantic = "^2.4.2"
pydantic-settings = "^2.0.3"
transformers = "^4.34.1"
transformers = "^4.36.2"
numpy = "^1.26.1"
python-dotenv = "^1.0.0"
torch = "^2.1.1"
ray = "^2.7.1"
torch = "^2.1.2"
ray = "^2.9.0"
tqdm = "^4.66.1"
tabulate = "^0.9.0"
thefuzz = "^0.20.0"
Expand Down

0 comments on commit fd261fb

Please sign in to comment.