Made call of model to device global in app.py file
Browse files166 unmodified lines16716816917017117250 unmodified lines22322422522622722822923085 unmodified lines316317318319320321322323166 unmodified linesdevice = get_device()model, transform = build_model_and_transforms(args)examples = [["strawberry.jpg", "strawberry", {"image": "strawberry.jpg"}],50 unmodified lines@spaces.GPUdef count(image, text, prompts, state, device):model.to(device)keywords = "" # do not handle this for now# Handle no prompt case.85 unmodified lines@spaces.GPUdef count_main(image, text, prompts, device):model.to(device)keywords = "" # do not handle this for now# Handle no prompt case.if prompts is None:166 unmodified lines16716816917017117217350 unmodified lines22422522622722822985 unmodified lines315316317318319320166 unmodified linesdevice = get_device()model, transform = build_model_and_transforms(args)model = model.to(device)examples = [["strawberry.jpg", "strawberry", {"image": "strawberry.jpg"}],50 unmodified lines@spaces.GPUdef count(image, text, prompts, state, device):keywords = "" # do not handle this for now# Handle no prompt case.85 unmodified lines@spaces.GPUdef count_main(image, text, prompts, device):keywords = "" # do not handle this for now# Handle no prompt case.if prompts is None:
app.py+1-4