Spaces:
Runtime error
Runtime error
hf_token
Browse files
app.py
CHANGED
@@ -4,10 +4,19 @@ import gradio as gr
|
|
4 |
from deepface import DeepFace
|
5 |
from datasets import load_dataset, DownloadConfig
|
6 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
os.system("rm -rf ~/.cache/huggingface/hub/datasets--Segizu--dataset_faces")
|
8 |
|
9 |
# ✅ Cargar el dataset de Hugging Face forzando la descarga limpia
|
10 |
-
download_config = DownloadConfig(
|
|
|
|
|
|
|
11 |
dataset = load_dataset("Segizu/facial-recognition", download_config=download_config)
|
12 |
if "train" in dataset:
|
13 |
dataset = dataset["train"]
|
|
|
4 |
from deepface import DeepFace
|
5 |
from datasets import load_dataset, DownloadConfig
|
6 |
import os
|
7 |
+
|
8 |
+
# 🔑 Configurar token de Hugging Face
|
9 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
10 |
+
if not HF_TOKEN:
|
11 |
+
raise ValueError("⚠️ Por favor, configura la variable de entorno HF_TOKEN para acceder al dataset privado")
|
12 |
+
|
13 |
os.system("rm -rf ~/.cache/huggingface/hub/datasets--Segizu--dataset_faces")
|
14 |
|
15 |
# ✅ Cargar el dataset de Hugging Face forzando la descarga limpia
|
16 |
+
download_config = DownloadConfig(
|
17 |
+
force_download=True,
|
18 |
+
token=HF_TOKEN
|
19 |
+
)
|
20 |
dataset = load_dataset("Segizu/facial-recognition", download_config=download_config)
|
21 |
if "train" in dataset:
|
22 |
dataset = dataset["train"]
|