Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -335,19 +335,9 @@ def process_image(image, question, confidence_threshold, examples=None):
|
|
335 |
|
336 |
en_intros.append(intro)
|
337 |
else:
|
338 |
-
#en_wiki_pedia_links.append("No English Wikipedia link found")
|
339 |
-
#en_intros.append("No information available")
|
340 |
print(links)
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
wiki_info = fetch_wikipedia_info(en_link)
|
345 |
-
# Try to get 'Contents' section, if it doesn't exist, try to get the first section
|
346 |
-
intro = wiki_info['sections'].get('Contents', '')
|
347 |
-
if not intro and wiki_info['sections']:
|
348 |
-
intro = next(iter(wiki_info['sections'].values()), '')
|
349 |
-
|
350 |
-
en_intros.append(intro)
|
351 |
if not names:
|
352 |
if os.path.exists(temp_image_path):
|
353 |
os.remove(temp_image_path)
|
|
|
335 |
|
336 |
en_intros.append(intro)
|
337 |
else:
|
|
|
|
|
338 |
print(links)
|
339 |
+
en_wiki_pedia_links.append("No English Wikipedia link found")
|
340 |
+
en_intros.append(f"This person is {name}.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
if not names:
|
342 |
if os.path.exists(temp_image_path):
|
343 |
os.remove(temp_image_path)
|