Avijit Ghosh commited on
Commit
b2d9196
1 Parent(s): 9a4a692

remove try except block

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -61,26 +61,24 @@ def showmodal(evt: gr.SelectData):
61
  itemdic = metadata_dict[evt.value]
62
 
63
  tags = itemdic['Hashtags']
64
- try:
65
- pd.notnull(float(tags))
66
- except:
67
- if len(tags)>0:
68
- tagstr = ''
69
- for tag in tags:
70
- tagstr += '<span class="tag">#'+tag+'</span> '
71
- tagsmd = gr.Markdown(tagstr, visible=True)
72
 
73
  titlemd = gr.Markdown('# ['+itemdic['Link']+']('+itemdic['URL']+')',visible=True)
74
 
75
  if pd.notnull(itemdic['Authors']):
76
  authormd = gr.Markdown('## '+itemdic['Authors'],visible=True)
 
77
  if pd.notnull(itemdic['Abstract']):
78
  abstractmd = gr.Markdown(itemdic['Abstract'],visible=True)
79
- try:
80
- pd.notnull(float(itemdic['Screenshots']))
81
- except:
82
- if len(itemdic['Screenshots'])>0:
83
- gallery = gr.Gallery(itemdic['Screenshots'],visible=True)
 
84
  return [modal, titlemd, authormd, tagsmd, abstractmd, gallery]
85
 
86
  with gr.Blocks(title = "Social Impact Measurement V2", css=custom_css) as demo: #theme=gr.themes.Soft(),
 
61
  itemdic = metadata_dict[evt.value]
62
 
63
  tags = itemdic['Hashtags']
64
+ if isinstance(tags, list):
65
+ if len(tags) > 0:
66
+ tagstr = ''.join(['<span class="tag">#'+tag+'</span> ' for tag in tags])
67
+ tagsmd = gr.Markdown(tagstr, visible=True)
 
 
 
 
68
 
69
  titlemd = gr.Markdown('# ['+itemdic['Link']+']('+itemdic['URL']+')',visible=True)
70
 
71
  if pd.notnull(itemdic['Authors']):
72
  authormd = gr.Markdown('## '+itemdic['Authors'],visible=True)
73
+
74
  if pd.notnull(itemdic['Abstract']):
75
  abstractmd = gr.Markdown(itemdic['Abstract'],visible=True)
76
+
77
+ screenshots = itemdic['Screenshots']
78
+ if isinstance(screenshots, list):
79
+ if len(screenshots) > 0:
80
+ gallery = gr.Gallery(screenshots, visible=True)
81
+
82
  return [modal, titlemd, authormd, tagsmd, abstractmd, gallery]
83
 
84
  with gr.Blocks(title = "Social Impact Measurement V2", css=custom_css) as demo: #theme=gr.themes.Soft(),