Shilpaj commited on
Commit
35e684f
·
1 Parent(s): 8bf4957

Fix: Runtime error

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -81,6 +81,8 @@ def main():
81
  global model, classes
82
 
83
  try:
 
 
84
  # Load the model at startup
85
  model = load_model("resnet50_imagenet1k.pth")
86
 
@@ -186,19 +188,16 @@ def main():
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",
195
  server_port=7860,
196
- share=False,
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:
203
  print(f"Error during startup: {str(e)}")
204
  if torch.cuda.is_available():
 
81
  global model, classes
82
 
83
  try:
84
+ print(f"Gradio version: {gr.__version__}")
85
+
86
  # Load the model at startup
87
  model = load_model("resnet50_imagenet1k.pth")
88
 
 
188
  label="Click on any example to run GradCAM"
189
  )
190
 
191
+ # Configure queue
192
+ demo.queue()
193
 
194
+ # Launch with minimal parameters
195
  demo.launch(
196
  server_name="0.0.0.0",
197
  server_port=7860,
198
+ share=False
 
 
 
 
199
  )
200
+
201
  except Exception as e:
202
  print(f"Error during startup: {str(e)}")
203
  if torch.cuda.is_available():