Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -250,26 +250,25 @@ def get_akc_breeds_link():
|
|
250 |
# iface.launch()
|
251 |
|
252 |
|
253 |
-
|
254 |
def format_description(description, breed):
|
255 |
if isinstance(description, dict):
|
256 |
-
# 確保每一個描述項目換行顯示,並避免重複顯示 Breed
|
257 |
formatted_description = "\n\n".join([f"**{key}**: {value}" for key, value in description.items()])
|
258 |
else:
|
259 |
formatted_description = description
|
260 |
|
261 |
-
|
262 |
-
**
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
"""
|
271 |
return formatted_description
|
272 |
|
|
|
273 |
async def predict_single_dog(image):
|
274 |
return await asyncio.to_thread(_predict_single_dog, image)
|
275 |
|
|
|
250 |
# iface.launch()
|
251 |
|
252 |
|
253 |
+
|
254 |
def format_description(description, breed):
|
255 |
if isinstance(description, dict):
|
|
|
256 |
formatted_description = "\n\n".join([f"**{key}**: {value}" for key, value in description.items()])
|
257 |
else:
|
258 |
formatted_description = description
|
259 |
|
260 |
+
akc_link = get_akc_breeds_link()
|
261 |
+
formatted_description += f"\n\n**Want to learn more about dog breeds?** [Visit the AKC dog breeds page]({akc_link}) and search for {breed} to find detailed information."
|
262 |
+
|
263 |
+
disclaimer = ("\n\n*Disclaimer: The external link provided leads to the American Kennel Club (AKC) dog breeds page. "
|
264 |
+
"You may need to search for the specific breed on that page. "
|
265 |
+
"I am not responsible for the content on external sites. "
|
266 |
+
"Please refer to the AKC's terms of use and privacy policy.*")
|
267 |
+
formatted_description += disclaimer
|
268 |
+
|
|
|
269 |
return formatted_description
|
270 |
|
271 |
+
|
272 |
async def predict_single_dog(image):
|
273 |
return await asyncio.to_thread(_predict_single_dog, image)
|
274 |
|