modal-omniparser

A serverless compute port of the OmniParser vision model for the Modal platform.
git clone https://unitehenry.com/git/modal-omniparser.git
Log | Files | Refs | README

commit fb61aacd7feaf4a91f0385fdf637ee0a01682e6a
parent 6b8cae3f612c0196df880072895166d7c72aa5cb
Author: Henry Unite <unitehenry@gmail.com>
Date:   Fri, 13 Mar 2026 18:33:02 +0000

feat: run modal functions

Diffstat:
Mscripts/run | 2+-
Msrc/app.py | 7++++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/run b/scripts/run @@ -1,2 +1,2 @@ #!/usr/bin/env bash -uv run modal run src/app.py::model_to_cuda +uv run modal run src/app.py::$1 diff --git a/src/app.py b/src/app.py @@ -62,7 +62,12 @@ def model_to_cuda(): print('model to {}'.format(device)) -@app.function(gpu="h100", image=image) +@app.function(gpu="h100", image=image, volumes={"/data": vol}) def get_caption_model_processor(): + import subprocess + + subprocess.run(["mv", "-f", "--", "/data/.paddleocr", "/root"], check=False) + subprocess.run(["mv", "-f", "--", "/data/.EasyOCR", "/root"], check=False) + from util.utils import get_som_labeled_img, check_ocr_box, get_caption_model_processor, get_yolo_model get_caption_model_processor(model_name="florence2", model_name_or_path="weights/icon_caption_florence", device='cuda')