3morrrrr commited on
Commit
777152b
·
verified ·
1 Parent(s): 3c6ea42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -11,10 +11,15 @@ from roboflow import Roboflow
11
  from gradio_client import Client
12
  import gradio as gr
13
 
14
- # -------------------------------------------------------------------------
15
- # Clear old Gradio client cache (prevents "No API found" errors)
16
- # -------------------------------------------------------------------------
17
- Client.clear_cache()
 
 
 
 
 
18
 
19
  # -------------------------------------------------------------------------
20
  # Logging configuration
 
11
  from gradio_client import Client
12
  import gradio as gr
13
 
14
+
15
+ # --- Safely clear Gradio client cache (for older/newer versions) ---
16
+ try:
17
+ cache_dir = os.path.expanduser("~/.cache/gradio")
18
+ if os.path.exists(cache_dir):
19
+ shutil.rmtree(cache_dir)
20
+ print("🧹 Cleared Gradio client cache manually.")
21
+ except Exception as e:
22
+ print(f"Warning: Could not clear Gradio cache ({e})")
23
 
24
  # -------------------------------------------------------------------------
25
  # Logging configuration