Thanh Vinh Vo
commited on
Commit
·
bcd395a
1
Parent(s):
2022fb1
update
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ def get_image(file_name: str) -> Image.Image:
|
|
| 56 |
# Try to open the image
|
| 57 |
image_bytes = BytesIO(response.content)
|
| 58 |
image = Image.open(image_bytes)
|
| 59 |
-
return image
|
| 60 |
|
| 61 |
except requests.exceptions.RequestException as e:
|
| 62 |
raise ValueError(f"Failed to fetch image from {url}: {e}")
|
|
@@ -128,7 +128,7 @@ class BasicAgent:
|
|
| 128 |
|
| 129 |
Please follow hints below:
|
| 130 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
| 131 |
-
2. `pandas` Python package is provided. Please use it when there is need to extract structured data (such as tables) from HTML content.
|
| 132 |
3. `chess` Python package is provided. Please use it when there is need to solve chess problems.
|
| 133 |
4. Please take the question literally! Do not add any additional information or assumptions.
|
| 134 |
""",
|
|
@@ -172,7 +172,7 @@ class BasicAgent:
|
|
| 172 |
"{question} {"The file name for this question is: " if has_file else ""} {question_id if has_file else ""}".
|
| 173 |
Please follow hints below:
|
| 174 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
| 175 |
-
2. `pandas` Python package is provided. Please use it when there is need to extract structured data (such as tables) from HTML content.
|
| 176 |
3. `chess` Python package is provided. Please use it when there is need to solve chess problems.
|
| 177 |
4. Please take the question literally! Do not add any additional information or assumptions.
|
| 178 |
"""
|
|
|
|
| 56 |
# Try to open the image
|
| 57 |
image_bytes = BytesIO(response.content)
|
| 58 |
image = Image.open(image_bytes)
|
| 59 |
+
return image
|
| 60 |
|
| 61 |
except requests.exceptions.RequestException as e:
|
| 62 |
raise ValueError(f"Failed to fetch image from {url}: {e}")
|
|
|
|
| 128 |
|
| 129 |
Please follow hints below:
|
| 130 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
| 131 |
+
2. `pandas` Python package is provided. Please use it when there is need to extract structured data (such as tables) from HTML content (such as Wikipedia tables).
|
| 132 |
3. `chess` Python package is provided. Please use it when there is need to solve chess problems.
|
| 133 |
4. Please take the question literally! Do not add any additional information or assumptions.
|
| 134 |
""",
|
|
|
|
| 172 |
"{question} {"The file name for this question is: " if has_file else ""} {question_id if has_file else ""}".
|
| 173 |
Please follow hints below:
|
| 174 |
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
| 175 |
+
2. `pandas` Python package is provided. Please use it when there is need to extract structured data (such as tables) from HTML content (such as Wikipedia tables).
|
| 176 |
3. `chess` Python package is provided. Please use it when there is need to solve chess problems.
|
| 177 |
4. Please take the question literally! Do not add any additional information or assumptions.
|
| 178 |
"""
|