Downloads · 30 days
10
13% of all-time downloads
afsagag/bart-spotify-preferences
bart-spotify-preferences is a machine learning model from afsagag. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a fine-tuned BART-large model for converting music prompts to Spotify feature preferences (e.g., Energy, Valence, Release Year). Fine-tuned on a ~1k sample dataset in Kaggle.
Downloads · 30 days
10
13% of all-time downloads
All-time downloads
80
Public
Parameters
406M
1.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
This is a fine-tuned BART-large model for converting music prompts to Spotify feature preferences (e.g., Energy, Valence, Release Year). Fine-tuned on a ~1k sample dataset in Kaggle.
from transformers import BartForConditionalGeneration, BartTokenizer
model = BartForConditionalGeneration.from_pretrained("afsagag/bart-spotify-preferences")
tokenizer = BartTokenizer.from_pretrained("afsagag/bart-spotify-preferences")
prompt = "music for a supervillain"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=256, num_beams=1, length_penalty=0.6, no_repeat_ngram_size=2, early_stopping=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))