AlexHung29629 commited on
Commit
c443b84
·
verified ·
1 Parent(s): 1dee560

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -13,7 +13,7 @@ processor = Pix2StructProcessor.from_pretrained("google/pix2struct-screen2words-
13
  # Define the function
14
  @spaces.GPU
15
  def describe_ui(image):
16
- inputs = processor(images=image, text="describe this image: ", return_tensors="pt").to("cuda")
17
  predictions = model.generate(**inputs)
18
  return processor.decode(predictions[0], skip_special_tokens=True)
19
 
 
13
  # Define the function
14
  @spaces.GPU
15
  def describe_ui(image):
16
+ inputs = processor(images=image, text="describe this image: ", return_tensors="pt").to(dtype=torch.bfloat16, device="cuda")
17
  predictions = model.generate(**inputs)
18
  return processor.decode(predictions[0], skip_special_tokens=True)
19