Spaces:
Sleeping
Sleeping
File size: 1,685 Bytes
d382306 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
import torch
import mistral as Mistral
device = "cuda" if torch.cuda.is_available() else "cpu"
song = ["\"And We Run (feat. Xzibit)\" by Within Temptation and Xzibit"]
top_ten = [
"\"Angels\" by Within Temptation",
"\"Stand My Ground\" by Within Temptation",
"\"The Gathering\" by Delain",
"\"April Rain\" by Delain",
"\"Strange Machines\" by The Gathering",
"\"We Are the Others\" by Delain",
"\"See Me In Shadow\" by Delain",
"\"Leaves\" by The Gathering",
"\"Saturnine\" by The Gathering",
"\"Frozen\" by Delain"
]
next_ten = [
"\'No More\" by Nemesea",
"\"Eleanor\" by The Gathering",
"\"In Motion #1\" by The Gathering",
"\"The Evil that Men Do - Remastered\" by After Forever",
"\"In Control\" by Nemesea",
"\"Allein - Bonus Track\" by Nemasea",
"\"Colder\" by End of the Dream",
"\"Summertime Sadness\" by Within Temptation",
"\"Sinéad - Benno de Goeij Remix\" by Within Temptation and Benno De Goeij",
"\"Sinéad - Alex M.O.R.P.H. Radio Edit\" by Within Temptation and Alex M.O.R.P.H"
]
selected = [
"\"Take Me Home, Country Roads\" by John Denver",
"\"Take On Me\" by a-ha",
"\"Africa\" by Toto"
]
if __name__ == '__main__':
me = Mistral.MistralExplainer(device)
print("\n#=#=#=#=#=#\n")
me.explain_why(song, top_ten)
print(me.get_positive_explanations())
print("\n#=#=#=#=#=#\n")
me.explain_why_these_arent_top(song, top_ten, next_ten)
print(me.get_constrastive_explanations())
print("\n#=#=#=#=#=#\n")
me.explain_why_not_these_songs(song, top_ten, selected)
print(me.get_other_constrastive_explanations())
print("\n#=#=#=#=#=#\n")
## |