Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -134,23 +134,23 @@ def get_akc_breeds_link():
|
|
134 |
return "https://www.akc.org/dog-breeds/"
|
135 |
|
136 |
|
137 |
-
def format_description(description, breed):
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
-
|
145 |
-
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
153 |
-
|
154 |
|
155 |
|
156 |
async def predict_single_dog(image):
|
@@ -556,7 +556,7 @@ async def predict(image):
|
|
556 |
else:
|
557 |
html_output += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
558 |
|
559 |
-
|
560 |
|
561 |
if buttons:
|
562 |
html_output += """
|
|
|
134 |
return "https://www.akc.org/dog-breeds/"
|
135 |
|
136 |
|
137 |
+
# def format_description(description, breed):
|
138 |
+
# if isinstance(description, dict):
|
139 |
+
# # 確保每一個描述項目換行顯示
|
140 |
+
# formatted_description = "\n\n".join([f"**{key}**: {value}" for key, value in description.items()])
|
141 |
+
# else:
|
142 |
+
# formatted_description = description
|
143 |
|
144 |
+
# akc_link = get_akc_breeds_link()
|
145 |
+
# 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."
|
146 |
|
147 |
+
# disclaimer = ("\n\n*Disclaimer: The external link provided leads to the American Kennel Club (AKC) dog breeds page. "
|
148 |
+
# "You may need to search for the specific breed on that page. "
|
149 |
+
# "I am not responsible for the content on external sites. "
|
150 |
+
# "Please refer to the AKC's terms of use and privacy policy.*")
|
151 |
+
# formatted_description += disclaimer
|
152 |
|
153 |
+
# return formatted_description
|
154 |
|
155 |
|
156 |
async def predict_single_dog(image):
|
|
|
556 |
else:
|
557 |
html_output += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
558 |
|
559 |
+
html_output += '</div>'
|
560 |
|
561 |
if buttons:
|
562 |
html_output += """
|