Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -11,13 +11,14 @@ tqdm.pandas()
|
|
| 11 |
|
| 12 |
api = HfApi()
|
| 13 |
token = os.getenv("token") # Das Token wird aus den Hugging Face Secrets abgerufen
|
|
|
|
| 14 |
|
| 15 |
# Überprüfen, ob das Token vorhanden ist
|
| 16 |
if token is None:
|
| 17 |
raise ValueError("Hugging Face API-Token ist nicht gesetzt.")
|
| 18 |
|
| 19 |
# Klonen Sie das Repository (dies wird in Ihrem Space ausgeführt)
|
| 20 |
-
repo = Repository(local_dir="SpotifyHitPrediction", clone_from="https://huggingface.co/Add1E/SpotifyHitPrediction", use_auth_token=
|
| 21 |
|
| 22 |
def predict_popularity(features, trainset):
|
| 23 |
predictions = [None] * 2
|
|
|
|
| 11 |
|
| 12 |
api = HfApi()
|
| 13 |
token = os.getenv("token") # Das Token wird aus den Hugging Face Secrets abgerufen
|
| 14 |
+
tokenread = os.getenv("tokenread")
|
| 15 |
|
| 16 |
# Überprüfen, ob das Token vorhanden ist
|
| 17 |
if token is None:
|
| 18 |
raise ValueError("Hugging Face API-Token ist nicht gesetzt.")
|
| 19 |
|
| 20 |
# Klonen Sie das Repository (dies wird in Ihrem Space ausgeführt)
|
| 21 |
+
repo = Repository(local_dir="SpotifyHitPrediction", clone_from="https://huggingface.co/Add1E/SpotifyHitPrediction", use_auth_token=tokenread)
|
| 22 |
|
| 23 |
def predict_popularity(features, trainset):
|
| 24 |
predictions = [None] * 2
|