ahuang11 commited on
Commit
f2d7c0f
1 Parent(s): ae2f34e

Removed icons

Browse files
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -1,21 +1,21 @@
1
  import io
2
  import random
3
- import panel as pn
4
- import aiohttp
5
 
 
 
6
  from PIL import Image
7
-
8
- from transformers import CLIPProcessor, CLIPModel
9
- from typing import List, Tuple
10
 
11
  pn.extension(design="bootstrap", sizing_mode="stretch_width")
12
 
13
- ICON_URLS = {
14
- "brand-github": "https://github.com/holoviz/panel",
15
- "brand-twitter": "https://twitter.com/Panel_Org",
16
- "brand-linkedin": "https://www.linkedin.com/company/panel-org",
17
- "message-circle": "https://discourse.holoviz.org/",
18
- "brand-discord": "https://discord.gg/AXRHnJU6sP",
 
19
  }
20
 
21
 
@@ -119,18 +119,16 @@ interactive_result = pn.panel(
119
  )
120
 
121
  # add footer
122
- footer_row = pn.Row(pn.Spacer(), align="center")
123
- for icon, url in ICON_URLS.items():
124
- href_button = pn.widgets.Button(icon=icon, width=35, height=35)
125
- href_button.js_on_click(code=f"window.open('{url}')")
126
- footer_row.append(href_button)
127
- footer_row.append(pn.Spacer())
128
 
129
  # create dashboard
130
  main = pn.WidgetBox(
131
  input_widgets,
132
  interactive_result,
133
- footer_row,
134
  )
135
 
136
  title = "Panel Demo - Image Classification"
 
1
  import io
2
  import random
3
+ from typing import List, Tuple
 
4
 
5
+ import aiohttp
6
+ import panel as pn
7
  from PIL import Image
8
+ from transformers import CLIPModel, CLIPProcessor
 
 
9
 
10
  pn.extension(design="bootstrap", sizing_mode="stretch_width")
11
 
12
+ EXTERNAL_LINKS = {
13
+ "Source Code": "https://huggingface.co/spaces/Panel-Org/panel-template/blob/main/app.py",
14
+ "GitHub": "https://github.com/holoviz/panel",
15
+ "Twitter": "https://twitter.com/Panel_Org",
16
+ "LinkedIn": "https://www.linkedin.com/company/panel-org",
17
+ "Discourse": "https://discourse.holoviz.org/",
18
+ "Discord": "https://discord.gg/AXRHnJU6sP",
19
  }
20
 
21
 
 
119
  )
120
 
121
  # add footer
122
+ footer = pn.pane.Markdown(
123
+ " | ".join(f"[{name}]({link})" for name, link in EXTERNAL_LINKS.items()),
124
+ justify="center",
125
+ )
 
 
126
 
127
  # create dashboard
128
  main = pn.WidgetBox(
129
  input_widgets,
130
  interactive_result,
131
+ footer,
132
  )
133
 
134
  title = "Panel Demo - Image Classification"