Ashrafb commited on
Commit
0b1eb16
·
verified ·
1 Parent(s): bd91ded

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -3
main.py CHANGED
@@ -188,9 +188,7 @@ class Model():
188
  return ((y_tilde[0].cpu().numpy().transpose(1, 2, 0) + 1.0) * 127.5).astype(np.uint8), 'Successfully toonify the image with style of %s'%(self.style_name)
189
 
190
 
191
- @app.on_event("startup")
192
- async def load_model():
193
- global model
194
  model = Model(device='cuda' if torch.cuda.is_available() else 'cpu')
195
 
196
  from fastapi.responses import StreamingResponse
 
188
  return ((y_tilde[0].cpu().numpy().transpose(1, 2, 0) + 1.0) * 127.5).astype(np.uint8), 'Successfully toonify the image with style of %s'%(self.style_name)
189
 
190
 
191
+
 
 
192
  model = Model(device='cuda' if torch.cuda.is_available() else 'cpu')
193
 
194
  from fastapi.responses import StreamingResponse