Spaces:
Runtime error
Runtime error
fix: images preprocess error
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ image_processor = git_processor_base.image_processor
|
|
| 28 |
def preprocess_image(image):
|
| 29 |
"""Преобразуем изображение для модели"""
|
| 30 |
image_rgb = image.convert("RGB")
|
| 31 |
-
return image_processor(image_rgb, return_tensors="pt").pixel_values.to(device)
|
| 32 |
|
| 33 |
|
| 34 |
def translate_ru2en(text):
|
|
|
|
| 28 |
def preprocess_image(image):
|
| 29 |
"""Преобразуем изображение для модели"""
|
| 30 |
image_rgb = image.convert("RGB")
|
| 31 |
+
return image_processor([image_rgb], return_tensors="pt").pixel_values.to(device)
|
| 32 |
|
| 33 |
|
| 34 |
def translate_ru2en(text):
|