CoolFace
Apppublic

cocktailpeanut/paligemma

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
App README

PaliGemma Demo

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

[Blogpost]: https://huggingface.co/blog/paligemma

[big_vision README.md]: https://github.com/google-research/bigvision/blob/main/bigvision/configs/proj/paligemma/README.md

Development

Local testing (CPU, Python 3.12):

bash
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.