Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
#
|
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:
|