adamelliotfields commited on
Commit
627b441
Β·
1 Parent(s): ad24d66

Change logo and icon

Browse files
0_🏠_Home.py CHANGED
@@ -4,18 +4,18 @@ from lib import config
4
 
5
  st.set_page_config(
6
  page_title=f"Home - {config.title}",
7
- page_icon=config.logo,
8
  layout=config.layout,
9
  )
10
 
11
  # sidebar
12
- st.logo(config.logo)
13
 
14
  # title
15
  st.html("""
16
  <style>
17
- /* https://huggingface.co/subscribe/pro */
18
  .pro-badge {
 
19
  display: inline-block;
20
  transform: skew(-12deg);
21
  font-size: 0.875rem;
@@ -28,19 +28,15 @@ st.html("""
28
  background-image: linear-gradient(to bottom right, #f9a8d4, #a7f3d0, #fde68a);
29
  border: 1px solid rgb(229 231 235 / 1);
30
  }
31
- @media (prefers-color-scheme: dark) {
32
- .pro-badge {
33
- box-shadow: 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgb(16 185 129 / .2), 0 4px 6px -4px rgb(16 185 129 / .2);
34
- background-image: linear-gradient(to bottom right, #ec4899, #10b981, #f59e0b);
35
- border: 1px solid rgb(20 28 46 / 1);
36
- }
37
- }
38
  </style>
39
  <div style="display: flex; align-items: center; gap: 0.75rem">
40
  <h1>Playground</h1>
41
  <span class="pro-badge">API</span>
42
  </div>
43
  <p>Explore popular generative AI endpoints.</p>
 
 
 
44
  """)
45
 
46
  st.markdown("## Tasks")
@@ -57,9 +53,7 @@ st.markdown("""
57
  - [OpenAI](https://platform.openai.com/docs/api-reference/introduction)
58
  - [Perplexity](https://docs.perplexity.ai/home)
59
  - [together.ai](https://docs.together.ai/docs/introduction)
60
- """)
61
 
62
- st.markdown("""
63
  ## Usage
64
 
65
  Select a task. Choose a service. Enter your API key (refresh browser to clear).
 
4
 
5
  st.set_page_config(
6
  page_title=f"Home - {config.title}",
7
+ page_icon=config.icon,
8
  layout=config.layout,
9
  )
10
 
11
  # sidebar
12
+ st.logo(config.logo, size="small")
13
 
14
  # title
15
  st.html("""
16
  <style>
 
17
  .pro-badge {
18
+ /* https://huggingface.co/subscribe/pro */
19
  display: inline-block;
20
  transform: skew(-12deg);
21
  font-size: 0.875rem;
 
28
  background-image: linear-gradient(to bottom right, #f9a8d4, #a7f3d0, #fde68a);
29
  border: 1px solid rgb(229 231 235 / 1);
30
  }
 
 
 
 
 
 
 
31
  </style>
32
  <div style="display: flex; align-items: center; gap: 0.75rem">
33
  <h1>Playground</h1>
34
  <span class="pro-badge">API</span>
35
  </div>
36
  <p>Explore popular generative AI endpoints.</p>
37
+ <a href="https://huggingface.co/spaces/adamelliotfields/playground?duplicate=true" target="_blank" rel="noopener noreferrer">
38
+ <img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg" alt="Duplicate this Space" />
39
+ </a>
40
  """)
41
 
42
  st.markdown("## Tasks")
 
53
  - [OpenAI](https://platform.openai.com/docs/api-reference/introduction)
54
  - [Perplexity](https://docs.perplexity.ai/home)
55
  - [together.ai](https://docs.together.ai/docs/introduction)
 
56
 
 
57
  ## Usage
58
 
59
  Select a task. Choose a service. Enter your API key (refresh browser to clear).
lib/config.py CHANGED
@@ -98,6 +98,7 @@ class AppConfig:
98
  title: str
99
  layout: str
100
  logo: str
 
101
  timeout: int
102
  hidden_parameters: List[str]
103
  services: Dict[str, ServiceConfig]
@@ -150,7 +151,8 @@ _pplx_text_kwargs = {
150
  config = AppConfig(
151
  title="Playground",
152
  layout="wide",
153
- logo="logo.png",
 
154
  timeout=60,
155
  hidden_parameters=[
156
  # Sent to API but not shown in generation parameters accordion
 
98
  title: str
99
  layout: str
100
  logo: str
101
+ icon: str
102
  timeout: int
103
  hidden_parameters: List[str]
104
  services: Dict[str, ServiceConfig]
 
151
  config = AppConfig(
152
  title="Playground",
153
  layout="wide",
154
+ logo="logo.svg",
155
+ icon="⚑",
156
  timeout=60,
157
  hidden_parameters=[
158
  # Sent to API but not shown in generation parameters accordion
logo.png DELETED
Binary file (4.03 kB)
 
logo.svg ADDED
pages/1_πŸ’¬_Text_Generation.py CHANGED
@@ -6,7 +6,7 @@ from lib import config, txt2txt_generate
6
 
7
  st.set_page_config(
8
  page_title=f"Text Generation - {config.title}",
9
- page_icon=config.logo,
10
  layout=config.layout,
11
  )
12
 
 
6
 
7
  st.set_page_config(
8
  page_title=f"Text Generation - {config.title}",
9
+ page_icon=config.icon,
10
  layout=config.layout,
11
  )
12
 
pages/2_🎨_Text_to_Image.py CHANGED
@@ -6,7 +6,7 @@ from lib import base64_encode_image_file, config, txt2img_generate
6
 
7
  st.set_page_config(
8
  page_title=f"Text to Image - {config.title}",
9
- page_icon=config.logo,
10
  layout=config.layout,
11
  )
12
 
 
6
 
7
  st.set_page_config(
8
  page_title=f"Text to Image - {config.title}",
9
+ page_icon=config.icon,
10
  layout=config.layout,
11
  )
12