github-actions[bot] commited on
Commit
dc98aef
·
1 Parent(s): 15ab737

Deploy from GitHub - 2026-01-20 10:49:21

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -14,13 +14,15 @@ Based on Johnson et al. "Perceptual Losses for Real-Time Style Transfer"
14
  https://arxiv.org/abs/1603.08155
15
  """
16
 
17
- # Fix for gradio_client boolean schema bug in HF Spaces
18
- import subprocess
 
19
  import sys
 
20
  try:
21
- subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "gradio-client>=1.8.0", "--quiet"])
22
  except Exception:
23
- pass # Best effort upgrade
24
 
25
  import gradio as gr
26
  import torch
 
14
  https://arxiv.org/abs/1603.08155
15
  """
16
 
17
+ # Fix for gradio_client boolean schema bug - MUST be before importing gradio
18
+ # Gradio 5.12+ installs gradio-client==1.5.4 which has the bug
19
+ # We upgrade to 1.8.0+ which fixes it, then import gradio
20
  import sys
21
+ import subprocess
22
  try:
23
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "gradio-client>=1.8.0", "--quiet", "--no-deps"])
24
  except Exception:
25
+ pass # Best effort - if it fails, continue anyway
26
 
27
  import gradio as gr
28
  import torch