Spaces:
Build error
Build error
Commit
·
17675dd
1
Parent(s):
8ba1705
Update app.py
Browse files
app.py
CHANGED
@@ -106,9 +106,27 @@ start = st.text_input("Beginning of the song:", "But for me to rap like a comput
|
|
106 |
TOKEN = "q_JK_BFy9OMiG7fGTzL-nUto9JDv3iXI24aYRrQnkOvjSCSbY4BuFIindweRsr5I"
|
107 |
genius = lyricsgenius.Genius(TOKEN)
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
if st.button("Run"):
|
111 |
with st.spinner(text=f"Downloading the model by {artist_name }..."):
|
112 |
artist = genius.search_artist(artist_name, max_songs=0, get_full_info=False)
|
113 |
if artist is not None:
|
114 |
-
|
|
|
|
|
|
|
|
106 |
TOKEN = "q_JK_BFy9OMiG7fGTzL-nUto9JDv3iXI24aYRrQnkOvjSCSbY4BuFIindweRsr5I"
|
107 |
genius = lyricsgenius.Genius(TOKEN)
|
108 |
|
109 |
+
model_html = """
|
110 |
+
|
111 |
+
<div class="inline-flex flex-col" style="line-height: 1.5;">
|
112 |
+
<div class="flex">
|
113 |
+
<div
|
114 |
+
style="display:DISPLAY_1; margin-left: auto; margin-right: auto; width: 92px; height:92px; border-radius: 50%; background-size: cover; background-image: url('USER_PROFILE')">
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div style="text-align: center; margin-top: 3px; font-size: 16px; font-weight: 800">🤖 HuggingArtists Model 🤖</div>
|
118 |
+
<div style="text-align: center; font-size: 16px; font-weight: 800">USER_NAME</div>
|
119 |
+
<a href="https://genius.com/artists/USER_HANDLE">
|
120 |
+
<div style="text-align: center; font-size: 14px;">@USER_HANDLE</div>
|
121 |
+
</a>
|
122 |
+
</div>
|
123 |
+
"""
|
124 |
|
125 |
if st.button("Run"):
|
126 |
with st.spinner(text=f"Downloading the model by {artist_name }..."):
|
127 |
artist = genius.search_artist(artist_name, max_songs=0, get_full_info=False)
|
128 |
if artist is not None:
|
129 |
+
artist_dict = genius.artist(artist.id)['artist']
|
130 |
+
artist_url = str(artist_dict['url'])
|
131 |
+
model_name = artist_url[artist_url.rfind('/') + 1:].lower()
|
132 |
+
st.markdown(model_html.format(USER_PROFILE=artist.image_url, USER_NAME=artist.name, USER_HANDLE=model_name ))
|