sjw commited on
Commit
8680297
β€’
1 Parent(s): a1ba2f0

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +9 -8
  2. messages.py +6 -9
app.py CHANGED
@@ -49,7 +49,7 @@ def debug_print(*args, **kwargs):
49
 
50
  THEME = gr.themes.Default(
51
  primary_hue=gr.themes.colors.stone,
52
- font=[gr.themes.GoogleFont("Days One"), "monospace", "sans-serif"],
53
  spacing_size=gr.themes.sizes.spacing_sm,
54
  radius_size=gr.themes.sizes.radius_sm,
55
  text_size=gr.themes.sizes.text_lg
@@ -64,7 +64,7 @@ THEME = gr.themes.Default(
64
 
65
 
66
  # TODO: switch to personal website
67
- REDIRECT_URI = "https://jonaswaller.com"
68
 
69
  # Spotify functions
70
  SCOPE = [
@@ -78,7 +78,7 @@ SCOPE = [
78
  MOOD_SETTINGS = {
79
  "happy": {"max_instrumentalness": 0.001, "min_valence": 0.6},
80
  "sad": {"max_danceability": 0.65, "max_valence": 0.4},
81
- "energetic": {"min_tempo": 120, "min_danceability": 0.75},
82
  "calm": {"max_energy": 0.65, "max_tempo": 130}
83
  }
84
 
@@ -884,13 +884,14 @@ with gr.Blocks(theme=THEME) as app:
884
 
885
  gr.Examples(["Play chill rap",
886
  "I'm feeling great, match my vibe",
887
- "Make me a relaxing playlist of SZA-like songs"],
888
- inputs=[msg], label="Quick Start πŸš€")
 
889
 
890
  gr.HTML('''
891
- <p class="hover-item" style="color: #808080; font-size: 13px; padding: 12px 0; text-align: left;">
892
- <a href="https://github.com/stuartwaller/Spotify-Chatbot" target="_blank">GitHub Repo</a> |
893
- I'd love to hear your feedback: stuart.j.waller@vanderbilt.edu
894
  </p>
895
  ''')
896
  app.launch()
 
49
 
50
  THEME = gr.themes.Default(
51
  primary_hue=gr.themes.colors.stone,
52
+ font=[gr.themes.GoogleFont("Quicksand"), "monospace", "sans-serif"],
53
  spacing_size=gr.themes.sizes.spacing_sm,
54
  radius_size=gr.themes.sizes.radius_sm,
55
  text_size=gr.themes.sizes.text_lg
 
64
 
65
 
66
  # TODO: switch to personal website
67
+ REDIRECT_URI = "https://stuartwaller.org"
68
 
69
  # Spotify functions
70
  SCOPE = [
 
78
  MOOD_SETTINGS = {
79
  "happy": {"max_instrumentalness": 0.001, "min_valence": 0.6},
80
  "sad": {"max_danceability": 0.65, "max_valence": 0.4},
81
+ "energetic": {"min_tempo": 110, "min_danceability": 0.70},
82
  "calm": {"max_energy": 0.65, "max_tempo": 130}
83
  }
84
 
 
884
 
885
  gr.Examples(["Play chill rap",
886
  "I'm feeling great, match my vibe",
887
+ "Make me a relaxing playlist of SZA-like songs",
888
+ "Play music for the beach"],
889
+ inputs=[msg], label="Examples")
890
 
891
  gr.HTML('''
892
+ <p class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0; text-align: left;">
893
+ <a href="https://github.com/stuartwaller/Spotify-Chatbot" target="_blank">GitHub</a> |
894
+ Feedback is much appreciated. Please reach out to stuart.j.waller@vanderbilt.edu
895
  </p>
896
  ''')
897
  app.launch()
messages.py CHANGED
@@ -70,22 +70,19 @@ HTML = """
70
  }
71
  .video-link {
72
  font-size: 14px;
73
- color: #808080 !important;
74
- }
75
- body * {
76
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
77
  }
78
  </style>
79
  </head>
80
  <body>
81
  <div class="container" style="text-align: left; margin-top: 50px;">
82
- <h1 style="color: #161C32; font-size: 56px;">Apollo<sup style="color: #AC83F3;">AI</sup> Music Assistant <a class="video-link" href="https://www.youtube.com/watch?v=fwKukm3qjsk">Overview</a></h1>
83
  <h2 style="color: #AC83F3; font-size: 26px;">Experience personalized, intelligent music interaction like never before</h2>
84
  <ul style="list-style-type: none; padding: 12px 0; margin: 0;">
85
- <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">1</span> Open your Spotify client</li>
86
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">2</span> Login to <a href="https://developer.spotify.com">Spotify Developer</a> website</li>
87
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">3</span> <a href="https://developer.spotify.com/dashboard">Dashboard</a> β†’ Create app</li>
88
- <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0; margin-bottom: -12px;"><span style="color: #AC83F3;">4</span> Set Redirect URI to <a href="https://jonaswaller.com">https://jonaswaller.com</a></li>
89
  <li style="color: #808080; font-size: 20px; padding: 0; margin-top: -12px; text-indent: 28px;">The other fields can be anything</li>
90
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">5</span> Save β†’ Settings</li>
91
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">6</span> Copy your Spotify Client ID</li>
@@ -116,7 +113,7 @@ Welcome! Tell me your **mood** to help me select the best music for you
116
 
117
 
118
  ERROR_MSG = """
119
- Error: Unable to **connect to your Spotify** | Please ensure you followed the above steps correctly
120
 
121
- Need help? Watch this brief tutorial https://www.youtube.com/watch?v=fwKukm3qjsk&t=211s
122
  """
 
70
  }
71
  .video-link {
72
  font-size: 14px;
73
+ color: red !important;
 
 
 
74
  }
75
  </style>
76
  </head>
77
  <body>
78
  <div class="container" style="text-align: left; margin-top: 50px;">
79
+ <h1 style="color: #161C32; font-size: 56px;">Apollo<sup style="color: red;">AI</sup> Music Assistant <a class="video-link" href="https://www.youtube.com/watch?v=onFEQMJL7ac&t=1s">Quickstart Video πŸš€</a></h1>
80
  <h2 style="color: #AC83F3; font-size: 26px;">Experience personalized, intelligent music interaction like never before</h2>
81
  <ul style="list-style-type: none; padding: 12px 0; margin: 0;">
82
+ <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">1</span> Open your Spotify Client</li>
83
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">2</span> Login to <a href="https://developer.spotify.com">Spotify Developer</a> website</li>
84
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">3</span> <a href="https://developer.spotify.com/dashboard">Dashboard</a> β†’ Create app</li>
85
+ <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0; margin-bottom: -12px;"><span style="color: #AC83F3;">4</span> Set Redirect URI to <a href="https://stuartwaller.org">https://stuartwaller.org</a></li>
86
  <li style="color: #808080; font-size: 20px; padding: 0; margin-top: -12px; text-indent: 28px;">The other fields can be anything</li>
87
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">5</span> Save β†’ Settings</li>
88
  <li class="hover-item" style="color: #808080; font-size: 26px; padding: 12px 0;"><span style="color: #AC83F3;">6</span> Copy your Spotify Client ID</li>
 
113
 
114
 
115
  ERROR_MSG = """
116
+ Unable to **connect to your Spotify** | Please ensure you followed the above steps correctly
117
 
118
+ Watch the Quickstart Video for assistance: https://www.youtube.com/watch?v=onFEQMJL7ac&t=1s
119
  """