weihongliang commited on
Commit
bc164b0
·
verified ·
1 Parent(s): d0647d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -12
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
- en_link = links['en']
342
- en_wiki_pedia_links.append(en_link)
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)