Spaces:
Running
Running
update app
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import streamlit as st
|
2 |
from lyrics_translator import LyricsTranslator
|
3 |
-
import os
|
4 |
|
5 |
|
6 |
-
config = {"GENIUS_ACCESS_TOKEN": st.secrets["GENIUS_ACCESS_TOKEN"]}
|
|
|
7 |
|
8 |
|
9 |
info = """
|
@@ -52,15 +52,28 @@ if is_button_results:
|
|
52 |
|
53 |
col1, col2 = st.columns(2)
|
54 |
|
55 |
-
with
|
56 |
-
with st.
|
57 |
try:
|
58 |
-
lyrics = translator.
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
|
|
|
|
64 |
|
|
|
|
|
|
|
|
|
|
|
65 |
except ValueError:
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from lyrics_translator import LyricsTranslator
|
|
|
3 |
|
4 |
|
5 |
+
# config = {"GENIUS_ACCESS_TOKEN": st.secrets["GENIUS_ACCESS_TOKEN"]}
|
6 |
+
config = None
|
7 |
|
8 |
|
9 |
info = """
|
|
|
52 |
|
53 |
col1, col2 = st.columns(2)
|
54 |
|
55 |
+
with col1.container():
|
56 |
+
with st.spinner("Fetching the song lyrics, this can take a while..."):
|
57 |
try:
|
58 |
+
lyrics = translator.get_song_lyrics(song, artist)
|
59 |
+
is_success = True
|
60 |
+
except ValueError:
|
61 |
+
col1.error("No lyrics found for this song!")
|
62 |
|
63 |
+
if is_success:
|
64 |
+
col1.success(f"Found lyrics for '{song}' by '{artist}'!")
|
65 |
+
col1.text(lyrics)
|
66 |
|
67 |
+
with col2.container():
|
68 |
+
with st.spinner("Song is being translated, this can take a while..."):
|
69 |
+
try:
|
70 |
+
text = translator.get_song_translation(song, artist)
|
71 |
+
is_success = True
|
72 |
except ValueError:
|
73 |
+
col2.error("No lyrics found for this song!")
|
74 |
+
|
75 |
+
if is_success:
|
76 |
+
col2.success(
|
77 |
+
f"Translated lyrics for '{song}' by '{artist}' to '{language_original}'!"
|
78 |
+
)
|
79 |
+
col2.text(text)
|