Spaces:
Sleeping
Sleeping
Fix: Queue issue
Browse files
app.py
CHANGED
|
@@ -186,6 +186,9 @@ def main():
|
|
| 186 |
label="Click on any example to run GradCAM"
|
| 187 |
)
|
| 188 |
|
|
|
|
|
|
|
|
|
|
| 189 |
# Launch the demo with reduced memory usage
|
| 190 |
demo.launch(
|
| 191 |
server_name="0.0.0.0",
|
|
@@ -194,7 +197,6 @@ def main():
|
|
| 194 |
debug=True,
|
| 195 |
show_error=True,
|
| 196 |
max_threads=1, # Reduce concurrent processing
|
| 197 |
-
enable_queue=True, # Enable queuing to prevent memory issues
|
| 198 |
cache_examples=False # Disable example caching
|
| 199 |
)
|
| 200 |
except Exception as e:
|
|
|
|
| 186 |
label="Click on any example to run GradCAM"
|
| 187 |
)
|
| 188 |
|
| 189 |
+
# Queue configuration before launch
|
| 190 |
+
demo.queue(max_size=5) # Replace enable_queue with queue() method
|
| 191 |
+
|
| 192 |
# Launch the demo with reduced memory usage
|
| 193 |
demo.launch(
|
| 194 |
server_name="0.0.0.0",
|
|
|
|
| 197 |
debug=True,
|
| 198 |
show_error=True,
|
| 199 |
max_threads=1, # Reduce concurrent processing
|
|
|
|
| 200 |
cache_examples=False # Disable example caching
|
| 201 |
)
|
| 202 |
except Exception as e:
|