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 a279c1f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 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.

0 comments on commit a279c1f

Please sign in to comment.