aagoluoglu commited on
Commit
d927c07
·
verified ·
1 Parent(s): 081a1ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -87,12 +87,12 @@ def load_model():
87
  device = "cuda" if torch.cuda.is_available() else "cpu"
88
  model.to(device)
89
 
90
- return model, processor
91
 
92
  def server(input: Inputs, output: Outputs, session: Session):
93
 
94
- # load model and processor once
95
- model, processor = load_model()
96
 
97
  @reactive.Calc
98
  def uploaded_image_path() -> str:
 
87
  device = "cuda" if torch.cuda.is_available() else "cpu"
88
  model.to(device)
89
 
90
+ return model, processor, device
91
 
92
  def server(input: Inputs, output: Outputs, session: Session):
93
 
94
+ # set model, processor, device once
95
+ model, processor, device = load_model()
96
 
97
  @reactive.Calc
98
  def uploaded_image_path() -> str: