Update tools.py
Browse files
tools.py
CHANGED
|
@@ -7,10 +7,10 @@ def extract_text(img_path: str) -> str:
|
|
| 7 |
Extract text from an image file using a multimodal model.
|
| 8 |
|
| 9 |
Args:
|
| 10 |
-
img_path: A
|
| 11 |
|
| 12 |
Returns:
|
| 13 |
-
A single string containing the concatenated text extracted from
|
| 14 |
"""
|
| 15 |
all_text = ""
|
| 16 |
try:
|
|
@@ -63,11 +63,11 @@ def describe_image(img_path: str, query: str) -> str:
|
|
| 63 |
following a specific query.
|
| 64 |
|
| 65 |
Args:
|
| 66 |
-
img_path: A
|
| 67 |
-
query: Information to extract from the image
|
| 68 |
|
| 69 |
Returns:
|
| 70 |
-
A single string containing a detailed
|
| 71 |
"""
|
| 72 |
try:
|
| 73 |
# Read image and encode as base64
|
|
|
|
| 7 |
Extract text from an image file using a multimodal model.
|
| 8 |
|
| 9 |
Args:
|
| 10 |
+
img_path: A string representing the url of an image (e.g., PNG, JPEG).
|
| 11 |
|
| 12 |
Returns:
|
| 13 |
+
A single string containing the concatenated text extracted from the image.
|
| 14 |
"""
|
| 15 |
all_text = ""
|
| 16 |
try:
|
|
|
|
| 63 |
following a specific query.
|
| 64 |
|
| 65 |
Args:
|
| 66 |
+
img_path: A string representing the url of an image (e.g., PNG, JPEG).
|
| 67 |
+
query: Information to extract from the image.
|
| 68 |
|
| 69 |
Returns:
|
| 70 |
+
A single string containing a detailed description of the image.
|
| 71 |
"""
|
| 72 |
try:
|
| 73 |
# Read image and encode as base64
|