nikigoli commited on
Commit
f0592fa
1 Parent(s): 1e21e58

switched device to cuda

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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('cpu')
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: