daniihc16's picture
Upload folder using huggingface_hub
c653359 verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
title: CLIP BLIP Document Classifier
emoji: 📄
colorFrom: blue
colorTo: green
sdk: gradio
app_file: app.py
pinned: false

Zero-Shot Document Classification with CLIP and BLIP

This Space classifies document images into three classes:

  • email
  • resume
  • scientific paper

It mirrors the approach used in your notebook:

  • CLIP zero-shot classification with prompt ensembling
  • BLIP classification with fallback chain: ITM -> VQA -> captioning
  • side-by-side score visualization

Notes

  • The first launch can be slow because model weights are downloaded.
  • If BLIP cannot be loaded due to memory limits, the app still works with CLIP.
  • The app tries to prepare real examples from nielsr/rvl_cdip_10_examples_per_class. If unavailable, placeholder examples are generated.

Local run

pip install -r requirements.txt
python app.py

Deploy script

python deploy_space.py --space-repo-id your_user/your_space_name

Use --private if you want a private Space.