big-vision/paligemma

Space

314

stars

3

commits

2

linked in READMEs

Jul 16, 2024

updated

gradio

README

PaliGemma Demo

See Blogpost and big_vision README.md for details about the model.

Development

Local testing (CPU, Python 3.12):

pip -m venv env
. env/bin/activate
pip install -qr requirements-cpu.txt
python app.py

Environment variables:

  • MOCK_MODEL=yes: For quick UI testing.
  • RAM_CACHE_GB=18: Enables caching of 3 bf16 models in memory: a single bf16 model is about 5860 MB. Use with care on spaces with little RAM. For example, on a A10G large space you can cache five models in RAM, so you would set RAM_CACHE_GB=30.
  • HOST_COLOCATION=4: If host RAM/disk is shared between 4 processes (e.g. the Huggingface A10 large Spaces).

Loading models:

  • The set of models loaded is defined in ./models.py.
  • You must first acknowledge usage conditions to access models.
  • When testing locally, you'll have to run huggingface_cli login.
  • When running in a Huggingface Space, you'll have to set a HF_TOKEN secret.

Contributors

andsteing

1 commits

mjlm

1 commits

big-vision/paligemma

Space

314

stars

3

commits

2

linked in READMEs

Jul 16, 2024

updated

gradio

README

PaliGemma Demo

See Blogpost and big_vision README.md for details about the model.

Development

Local testing (CPU, Python 3.12):

pip -m venv env
. env/bin/activate
pip install -qr requirements-cpu.txt
python app.py

Environment variables:

  • MOCK_MODEL=yes: For quick UI testing.
  • RAM_CACHE_GB=18: Enables caching of 3 bf16 models in memory: a single bf16 model is about 5860 MB. Use with care on spaces with little RAM. For example, on a A10G large space you can cache five models in RAM, so you would set RAM_CACHE_GB=30.
  • HOST_COLOCATION=4: If host RAM/disk is shared between 4 processes (e.g. the Huggingface A10 large Spaces).

Loading models:

  • The set of models loaded is defined in ./models.py.
  • You must first acknowledge usage conditions to access models.
  • When testing locally, you'll have to run huggingface_cli login.
  • When running in a Huggingface Space, you'll have to set a HF_TOKEN secret.

Contributors

andsteing

1 commits

mjlm

1 commits