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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,9 +13,9 @@ 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(dtype=torch.bfloat16, device="cuda")
17
  predictions = model.generate(**inputs)
18
- return processor.decode(predictions[0], skip_special_tokens=True)
19
 
20
  # Launch the Gradio interface
21
  gr.Interface(
 
13
  # Define the function
14
  @spaces.GPU
15
  def describe_ui(image):
16
+ inputs = processor(images=image, text="This is an image of ", return_tensors="pt").to(dtype=torch.bfloat16, device="cuda")
17
  predictions = model.generate(**inputs)
18
+ return processor.decode(predictions[0], skip_special_tokens=False)
19
 
20
  # Launch the Gradio interface
21
  gr.Interface(