Hi @kktim
You're facing a common challenge with Gradio apps in Databricks.
The issue is that Gradio apps run in a different execution context than notebooks,
so they don't have the same access to Unity Catalog volumes.
Here are several approaches to solve this:
Solution 1: Copy Files to DBFS During App Initialization
This is often the most reliable approach:
Solution 2: Use Databricks File System API
Access files programmatically using the Databricks API:
Solution 3: Mount Volume to DBFS
If you have admin access, you can mount the volume:
Solution 4: Environment Variables and Startup Script
Create a startup script that sets up the environment:
Solution 5: Use MLflow Model Registry
If these are ML models, consider using MLflow:
The key insight is that Gradio apps run in a containerized environment that doesn't have the same direct access to Unity Catalog volumes as notebooks do.
By copying the files during app initialization, you ensure they're available in the app's execution context.
LR