Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,6 +21,8 @@ max_tokens = 2000
|
|
| 21 |
|
| 22 |
@spaces.GPU
|
| 23 |
def perform_ocr(image):
|
|
|
|
|
|
|
| 24 |
"""Process image and extract text using OCR model"""
|
| 25 |
image = Image.fromarray(image)
|
| 26 |
src = str(uuid.uuid4()) + ".png"
|
|
|
|
| 21 |
|
| 22 |
@spaces.GPU
|
| 23 |
def perform_ocr(image):
|
| 24 |
+
if image == None:
|
| 25 |
+
return "Error Processing"
|
| 26 |
"""Process image and extract text using OCR model"""
|
| 27 |
image = Image.fromarray(image)
|
| 28 |
src = str(uuid.uuid4()) + ".png"
|