Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ hf_repo = "nvidia/RADIO-L"
|
|
| 9 |
|
| 10 |
image_processor = CLIPImageProcessor.from_pretrained(hf_repo)
|
| 11 |
model = AutoModel.from_pretrained(hf_repo, trust_remote_code=True)
|
| 12 |
-
model.eval()
|
| 13 |
|
| 14 |
|
| 15 |
title = """RADIO: Reduce All Domains Into One"""
|
|
@@ -141,6 +141,7 @@ def pad_image_to_multiple_of_16(image):
|
|
| 141 |
@spaces.GPU
|
| 142 |
def infer_radio(image):
|
| 143 |
"""Define the function to generate the output."""
|
|
|
|
| 144 |
image=pad_image_to_multiple_of_16(image)
|
| 145 |
width, height = image.size
|
| 146 |
pixel_values = image_processor(images=image, return_tensors='pt').pixel_values
|
|
|
|
| 9 |
|
| 10 |
image_processor = CLIPImageProcessor.from_pretrained(hf_repo)
|
| 11 |
model = AutoModel.from_pretrained(hf_repo, trust_remote_code=True)
|
| 12 |
+
model.eval()
|
| 13 |
|
| 14 |
|
| 15 |
title = """RADIO: Reduce All Domains Into One"""
|
|
|
|
| 141 |
@spaces.GPU
|
| 142 |
def infer_radio(image):
|
| 143 |
"""Define the function to generate the output."""
|
| 144 |
+
model.cuda()
|
| 145 |
image=pad_image_to_multiple_of_16(image)
|
| 146 |
width, height = image.size
|
| 147 |
pixel_values = image_processor(images=image, return_tensors='pt').pixel_values
|