CXM06's picture
cache structure
411f6c9

A newer version of the Gradio SDK is available: 6.14.0

Upgrade

Cache Directory

This directory stores cached data for the AI Image Caption Generator.

Directory Structure

cache/
β”œβ”€β”€ analytics.json       # Usage statistics and analytics (git-ignored, auto-created)
└── models/              # Cached ML models from Hugging Face (git-ignored)
    β”œβ”€β”€ models--microsoft--git-large-coco/
    └── models--Salesforce--blip-image-captioning-base/

What's Ignored

  • analytics.json: Contains user-specific analytics data
  • models/: Contains downloaded ML models (can be several GB)
  • All other cache files

What's Tracked

  • .gitkeep files: Preserve directory structure in Git
  • This README: Documentation for the cache directory

Automatic Creation

No manual setup required! Both files and directories are created automatically:

  • βœ… analytics.json is created automatically on first run with the correct structure
  • βœ… models/ directory is created automatically when models are downloaded
  • βœ… The cache directory structure is preserved via .gitkeep files

Analytics JSON Structure

The analytics.json file is automatically initialized with this structure:

{
    "total_captions": 0,
    "style_usage": {
        "None": 0,
        "Professional": 0,
        "Creative": 0,
        "Social Media": 0,
        "Technical": 0
    },
    "avg_processing_time": 0.0,
    "total_processing_time": 0.0,
    "model_usage": {
        "blip": 0,
        "git": 0
    },
    "error_count": 0,
    "last_updated": null
}

You don't need to create this file manually - it will be generated automatically when the app runs for the first time.

Notes

  • The cache directory is automatically created by the application
  • Models are downloaded on first use and cached here
  • Analytics data is stored in analytics.json (created automatically)
  • All cache contents are ignored by Git to avoid committing large files and user data
  • Each user gets their own analytics.json file with their usage statistics