Update app.py
Browse files
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="
|
| 17 |
predictions = model.generate(**inputs)
|
| 18 |
return processor.decode(predictions[0], skip_special_tokens=False)
|
| 19 |
|
|
|
|
| 13 |
# Define the function
|
| 14 |
@spaces.GPU
|
| 15 |
def describe_ui(image):
|
| 16 |
+
inputs = processor(images=image, text="<s>", 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 |
|