Spaces:
Runtime error
Runtime error
Upload: Multiple files to assets directory
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import io
|
|
10 |
import base64
|
11 |
import json
|
12 |
import time
|
|
|
13 |
|
14 |
from huggingface_hub import Repository
|
15 |
|
@@ -25,6 +26,19 @@ REFERENCE_FILE_URL = (
|
|
25 |
)
|
26 |
LOCAL_REF_PATH = "reference.csv" # Lo guardaremos con este nombre local
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
def setup_local_repo_for_push():
|
29 |
"""
|
30 |
Inicializa un objeto 'Repository' apuntando al mismo repo del Space.
|
@@ -43,8 +57,7 @@ def setup_local_repo_for_push():
|
|
43 |
use_auth_token=token
|
44 |
)
|
45 |
# Configurar user.name y user.email
|
46 |
-
|
47 |
-
repo.git_config("user.email", "[email protected]")
|
48 |
|
49 |
# Por si se actualiz贸 el Space en remoto
|
50 |
try:
|
|
|
10 |
import base64
|
11 |
import json
|
12 |
import time
|
13 |
+
import subprocess
|
14 |
|
15 |
from huggingface_hub import Repository
|
16 |
|
|
|
26 |
)
|
27 |
LOCAL_REF_PATH = "reference.csv" # Lo guardaremos con este nombre local
|
28 |
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
def git_set_identity(name: str, email: str):
|
34 |
+
"""Configura la identidad de git en el repo local."""
|
35 |
+
try:
|
36 |
+
subprocess.run(["git", "config", "user.name", name], check=True)
|
37 |
+
subprocess.run(["git", "config", "user.email", email], check=True)
|
38 |
+
except Exception as e:
|
39 |
+
print("Error setting git identity:", e)
|
40 |
+
|
41 |
+
|
42 |
def setup_local_repo_for_push():
|
43 |
"""
|
44 |
Inicializa un objeto 'Repository' apuntando al mismo repo del Space.
|
|
|
57 |
use_auth_token=token
|
58 |
)
|
59 |
# Configurar user.name y user.email
|
60 |
+
git_set_identity("JulioContrerasH", "[email protected]")
|
|
|
61 |
|
62 |
# Por si se actualiz贸 el Space en remoto
|
63 |
try:
|