Spaces:
Running
Running
Whitelist triplets snapshot dir for serving
Browse files
app.py
CHANGED
|
@@ -77,6 +77,10 @@ TRIPLETS_ROOT, TRIPLETS = load_triplets()
|
|
| 77 |
TRIPLET_BY_ID = {r["triplet_id"]: r for r in TRIPLETS}
|
| 78 |
print(f"loaded {len(TRIPLETS)} triplets from {TRIPLETS_ROOT}")
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
# ---------- session helpers ---------------------------------------------------
|
| 82 |
|
|
@@ -340,4 +344,4 @@ with gr.Blocks(title="Denoising A/B Judging", theme=gr.themes.Soft()) as demo:
|
|
| 340 |
|
| 341 |
|
| 342 |
if __name__ == "__main__":
|
| 343 |
-
demo.launch()
|
|
|
|
| 77 |
TRIPLET_BY_ID = {r["triplet_id"]: r for r in TRIPLETS}
|
| 78 |
print(f"loaded {len(TRIPLETS)} triplets from {TRIPLETS_ROOT}")
|
| 79 |
|
| 80 |
+
# Triplets live in the HF snapshot cache (outside the gradio working dir),
|
| 81 |
+
# so Gradio refuses to serve them by default. Whitelist the snapshot dir.
|
| 82 |
+
gr.set_static_paths([str(TRIPLETS_ROOT)])
|
| 83 |
+
|
| 84 |
|
| 85 |
# ---------- session helpers ---------------------------------------------------
|
| 86 |
|
|
|
|
| 344 |
|
| 345 |
|
| 346 |
if __name__ == "__main__":
|
| 347 |
+
demo.launch(allowed_paths=[str(TRIPLETS_ROOT)])
|