Spaces:
Running
Running
radio
Browse files- app.py +12 -3
- rappers.txt +53 -0
app.py
CHANGED
@@ -10,17 +10,26 @@ def load_model():
|
|
10 |
model = AutoModelForCausalLM.from_pretrained(model_ckpt,from_flax=True)
|
11 |
return tokenizer, model
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
title = st.title("Loading model")
|
15 |
tokenizer, model = load_model()
|
16 |
text_generation = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
17 |
title.title("Rap lyrics generator")
|
18 |
-
artist = st.text_input("Enter the artist", "Wu-Tang Clan")
|
19 |
-
|
|
|
|
|
20 |
|
21 |
|
22 |
|
23 |
-
if st.button("Generate lyrics"):
|
24 |
st.title(f"{artist}: {song_name}")
|
25 |
prefix_text = f"<BOS>{song_name} [Verse 1:{artist}]"
|
26 |
generated_song = text_generation(prefix_text, max_length=750, do_sample=True)[0]
|
|
|
10 |
model = AutoModelForCausalLM.from_pretrained(model_ckpt,from_flax=True)
|
11 |
return tokenizer, model
|
12 |
|
13 |
+
@st.cache()
|
14 |
+
def load_rappers():
|
15 |
+
text_file = open("rappers.txt")
|
16 |
+
rappers = text_file.readlines()
|
17 |
+
rappers.sort()
|
18 |
+
return rappers
|
19 |
+
|
20 |
|
21 |
title = st.title("Loading model")
|
22 |
tokenizer, model = load_model()
|
23 |
text_generation = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
24 |
title.title("Rap lyrics generator")
|
25 |
+
#artist = st.text_input("Enter the artist", "Wu-Tang Clan")
|
26 |
+
list_of_rappers = load_rappers()
|
27 |
+
artist = st.radio("Choose your rapper", tuple(list_of_rappers))
|
28 |
+
song_name = st.text_input("Enter the desired song name", "Shaolin")
|
29 |
|
30 |
|
31 |
|
32 |
+
if st.button("Generate lyrics", help="Press me!"):
|
33 |
st.title(f"{artist}: {song_name}")
|
34 |
prefix_text = f"<BOS>{song_name} [Verse 1:{artist}]"
|
35 |
generated_song = text_generation(prefix_text, max_length=750, do_sample=True)[0]
|
rappers.txt
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The Notorious B.I.G.
|
2 |
+
Big Pun
|
3 |
+
Big L
|
4 |
+
Nas
|
5 |
+
50 Cent
|
6 |
+
Prodigy
|
7 |
+
Action Bronson
|
8 |
+
Ill Bill
|
9 |
+
Lil Keed
|
10 |
+
Lil Keke
|
11 |
+
Lil Jon
|
12 |
+
Lil Bibby
|
13 |
+
Lil Tjay
|
14 |
+
Jay Z
|
15 |
+
Guru
|
16 |
+
Meek Mill
|
17 |
+
Yung Lean
|
18 |
+
Bladee
|
19 |
+
Tupac
|
20 |
+
Snoop Dogg
|
21 |
+
Eminem
|
22 |
+
Vince Staples
|
23 |
+
Rakim
|
24 |
+
Big daddy kane
|
25 |
+
Kendrick Lamar
|
26 |
+
Big Boi
|
27 |
+
Danny Brown
|
28 |
+
Freddie Gibbs
|
29 |
+
Tyler the creator
|
30 |
+
Frank Ocean
|
31 |
+
Earl Eweatshirt
|
32 |
+
Domo Genesis
|
33 |
+
Mike G
|
34 |
+
Raekwon
|
35 |
+
Ghostface Killah
|
36 |
+
RZA
|
37 |
+
GZA
|
38 |
+
Ol' Dirty Bastard
|
39 |
+
Method Man
|
40 |
+
Inspectah Deck
|
41 |
+
U-God
|
42 |
+
Masta Killa
|
43 |
+
Cappadonna
|
44 |
+
Kanye West
|
45 |
+
Lauryn Hill
|
46 |
+
Jean Grae
|
47 |
+
Lil Kim
|
48 |
+
Missy Elliot
|
49 |
+
Rah Digga
|
50 |
+
MC Lyte
|
51 |
+
Remy Ma
|
52 |
+
Missy Elliott
|
53 |
+
Foxy Brown
|