AMontiB commited on
Commit
b3a3661
Β·
1 Parent(s): a721e26

fix: add Gradio version compatibility and create .slugignore

Browse files
Files changed (2) hide show
  1. .slugignore +12 -0
  2. app.py +8 -1
.slugignore ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Exclude large files and directories not needed for Spaces
2
+ split.json
3
+ demo_images/
4
+ *.pt
5
+ *.pth
6
+ *.ckpt
7
+ *.safetensors
8
+ test_result*.json
9
+ __pycache__/
10
+ *.pyc
11
+ .DS_Store
12
+ .git
app.py CHANGED
@@ -94,7 +94,14 @@ def predict(image_path, detector_name):
94
  os.remove(output_path)
95
 
96
  # Create Gradio Interface
97
- with gr.Blocks(title="Deepfake Detection", theme=gr.themes.Soft()) as demo:
 
 
 
 
 
 
 
98
  gr.Markdown("# πŸ” Deepfake Detection Library")
99
  gr.Markdown("""
100
  Upload an image and select a detector to check if it's real or fake.
 
94
  os.remove(output_path)
95
 
96
  # Create Gradio Interface
97
+ # Use theme only if gradio version supports it
98
+ try:
99
+ demo = gr.Blocks(title="Deepfake Detection", theme=gr.themes.Soft())
100
+ except TypeError:
101
+ # Older gradio version doesn't support theme parameter
102
+ demo = gr.Blocks(title="Deepfake Detection")
103
+
104
+ with demo:
105
  gr.Markdown("# πŸ” Deepfake Detection Library")
106
  gr.Markdown("""
107
  Upload an image and select a detector to check if it's real or fake.