# Configuration for Cog ⚙️
# Reference: https://cog.run/yaml

build:
  # set to true if your model requires a GPU
  gpu: true

  # a list of ubuntu apt packages to install
  system_packages:
    - 'libgl1-mesa-glx'
    - 'libglib2.0-0'
    - 'libsm6'
    - 'libxext6'
    - 'libxrender-dev'
    - 'libgomp1'
    - 'wget'
    - 'git'

  # python version in the form '3.11' or '3.11.4'
  python_version: '3.12'

  # a list of packages in the format <package-name>==<version>
  python_packages:
    - --extra-index-url https://download.pytorch.org/whl/cu121
    - 'torch==2.3.1'
    - pillow==10.2.0
    - numpy==1.26.4
    - opencv-python-headless==4.9.0.80
    - easyocr==1.7.1
    - transformers==4.37.2
    - ultralytics==8.1.2
    - python-bidi==0.4.2
    - PyYAML>=5.3.1
    - scipy>=1.7.1
    - ninja>=1.10.2

  # commands to run after the environment is setup
  run:
    - pip3 cache purge
    - python3 -m pip install --upgrade pip
    - export PYTHONUNBUFFERED=1
    - export CUDA_VISIBLE_DEVICES=0
    - export TORCH_HOME=/src/.torch
    - export PIP_DISABLE_PIP_VERSION_CHECK=1
    - export PIP_NO_CACHE_DIR=1

# predict.py defines how predictions are run on your model
predict: 'predict.py:Predictor'