DawnC commited on
Commit
ff1e401
1 Parent(s): 4edafdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -250,26 +250,25 @@ def get_akc_breeds_link():
250
  # iface.launch()
251
 
252
 
253
- # Update the format_description to handle descriptions more cleanly
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
- formatted_description = f"""
262
- **Breed**: {breed}
263
- {formatted_description}
264
- **Want to learn more about dog breeds?**
265
- [Visit the AKC dog breeds page]({get_akc_breeds_link()}) and search for {breed} to find detailed information.
266
- *Disclaimer: The external link provided leads to the American Kennel Club (AKC) dog breeds page.
267
- You may need to search for the specific breed on that page.
268
- I am not responsible for the content on external sites.
269
- Please refer to the AKC's terms of use and privacy policy.*
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