ariG23498 HF Staff commited on
Commit
8983f6a
·
1 Parent(s): 2ba8f92

remove autocast

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -101,12 +101,7 @@ def detect(
101
  inputs = bundle.processor(images=image, text=texts, return_tensors="pt").to(DEVICE)
102
 
103
  with torch.inference_mode():
104
- if DEVICE == "cuda":
105
- # Use autocast to speed up mixed-precision-friendly ops
106
- with torch.amp.autocast():
107
- outputs = bundle.model(**inputs)
108
- else:
109
- outputs = bundle.model(**inputs)
110
 
111
  results = bundle.processor.post_process_grounded_object_detection(
112
  outputs, threshold=threshold, target_sizes=[image.size[::-1]]
 
101
  inputs = bundle.processor(images=image, text=texts, return_tensors="pt").to(DEVICE)
102
 
103
  with torch.inference_mode():
104
+ outputs = bundle.model(**inputs)
 
 
 
 
 
105
 
106
  results = bundle.processor.post_process_grounded_object_detection(
107
  outputs, threshold=threshold, target_sizes=[image.size[::-1]]