Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,13 +19,14 @@ def sepia(input_img):
|
|
| 19 |
## https://www.gradio.app/docs/gradio/blocks
|
| 20 |
## required positional arguments: 'inputs' and 'outputs'
|
| 21 |
def process_image(image):
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
def additional_input(text):
|
| 31 |
return f"Additional input received: {text}"
|
|
|
|
| 19 |
## https://www.gradio.app/docs/gradio/blocks
|
| 20 |
## required positional arguments: 'inputs' and 'outputs'
|
| 21 |
def process_image(image):
|
| 22 |
+
try:
|
| 23 |
+
# Run the image through the model
|
| 24 |
+
result = client(inputs=image)
|
| 25 |
+
# Extract the text from the result
|
| 26 |
+
text = result['text']
|
| 27 |
+
return text
|
| 28 |
+
except Exception as e:
|
| 29 |
+
return f"Error: {str(e)}"
|
| 30 |
|
| 31 |
def additional_input(text):
|
| 32 |
return f"Additional input received: {text}"
|