Spaces:
Sleeping
Sleeping
switched device to cuda
Browse files
app.py
CHANGED
@@ -166,7 +166,7 @@ args = parser.parse_args()
|
|
166 |
# args.device = torch.device('cuda')
|
167 |
#else:
|
168 |
# args.device = torch.device('cpu')
|
169 |
-
args.device = torch.device('
|
170 |
model, transform = build_model_and_transforms(args)
|
171 |
|
172 |
examples = [
|
@@ -315,6 +315,7 @@ def count(image, text, prompts, state, device):
|
|
315 |
@spaces.GPU
|
316 |
def count_main(image, text, prompts, device):
|
317 |
model.to(device)
|
|
|
318 |
keywords = "" # do not handle this for now
|
319 |
# Handle no prompt case.
|
320 |
if prompts is None:
|
|
|
166 |
# args.device = torch.device('cuda')
|
167 |
#else:
|
168 |
# args.device = torch.device('cpu')
|
169 |
+
args.device = torch.device('cuda')
|
170 |
model, transform = build_model_and_transforms(args)
|
171 |
|
172 |
examples = [
|
|
|
315 |
@spaces.GPU
|
316 |
def count_main(image, text, prompts, device):
|
317 |
model.to(device)
|
318 |
+
print("model device: " + str(model.device))
|
319 |
keywords = "" # do not handle this for now
|
320 |
# Handle no prompt case.
|
321 |
if prompts is None:
|