Spaces:
Sleeping
Sleeping
Upload 11 files
Browse files- gateway.py +5 -2
- refresh_sources.py +7 -0
gateway.py
CHANGED
|
@@ -151,8 +151,11 @@ class GatewayHandler(BaseHTTPRequestHandler):
|
|
| 151 |
self.wfile.write(body)
|
| 152 |
|
| 153 |
def log_message(self, format, *args):
|
| 154 |
-
"""Cleaner log format."""
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
|
| 158 |
def wait_for_clickhouse(timeout=60):
|
|
|
|
| 151 |
self.wfile.write(body)
|
| 152 |
|
| 153 |
def log_message(self, format, *args):
|
| 154 |
+
"""Cleaner log format. Ignores HF container ping logs for cleanliness."""
|
| 155 |
+
msg = format % args
|
| 156 |
+
if "?logs=container" in msg:
|
| 157 |
+
return
|
| 158 |
+
sys.stderr.write(f"[gateway] {self.address_string()} {msg}\n")
|
| 159 |
|
| 160 |
|
| 161 |
def wait_for_clickhouse(timeout=60):
|
refresh_sources.py
CHANGED
|
@@ -107,6 +107,13 @@ def main():
|
|
| 107 |
cmd = ["git", "clone", "--depth", clone_depth] + branch_flag + auth_flag + [repo_url, target_dir]
|
| 108 |
output, success = run_subprocess(cmd)
|
| 109 |
git_status = "cloned" if success else f"error_clone: {output}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
else:
|
| 111 |
# We want to fetch and hard reset
|
| 112 |
cmd_fetch = ["git"] + auth_flag + ["fetch", "--depth", "1", "origin"]
|
|
|
|
| 107 |
cmd = ["git", "clone", "--depth", clone_depth] + branch_flag + auth_flag + [repo_url, target_dir]
|
| 108 |
output, success = run_subprocess(cmd)
|
| 109 |
git_status = "cloned" if success else f"error_clone: {output}"
|
| 110 |
+
|
| 111 |
+
# Retrieve real files for Git LFS pointers natively used by Hugging Face Datasets
|
| 112 |
+
if success:
|
| 113 |
+
cmd_lfs = ["git", "lfs", "pull"]
|
| 114 |
+
out_lfs, suc_lfs = run_subprocess(cmd_lfs, cwd=target_dir)
|
| 115 |
+
if not suc_lfs:
|
| 116 |
+
git_status = f"error_lfs_pull: {out_lfs}"
|
| 117 |
else:
|
| 118 |
# We want to fetch and hard reset
|
| 119 |
cmd_fetch = ["git"] + auth_flag + ["fetch", "--depth", "1", "origin"]
|