Spaces:
Running on Zero
Running on Zero
Log why an invite call failed (tokens masked)
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ The same request body as TypeSafe's /v1/systemone works in the API tab.
|
|
| 7 |
import html
|
| 8 |
import json
|
| 9 |
import os
|
|
|
|
| 10 |
import threading
|
| 11 |
|
| 12 |
import gradio as gr
|
|
@@ -357,6 +358,7 @@ def decide_invite(request_json: str, lang: str, code: str, request: gr.Request)
|
|
| 357 |
except Exception as err: # noqa: BLE001
|
| 358 |
with _owner_lock:
|
| 359 |
_owner = None
|
|
|
|
| 360 |
raise gr.Error(t["invite_spent"] if "quota" in str(err).lower() else t["invite_down"]) from None
|
| 361 |
|
| 362 |
|
|
|
|
| 7 |
import html
|
| 8 |
import json
|
| 9 |
import os
|
| 10 |
+
import re
|
| 11 |
import threading
|
| 12 |
|
| 13 |
import gradio as gr
|
|
|
|
| 358 |
except Exception as err: # noqa: BLE001
|
| 359 |
with _owner_lock:
|
| 360 |
_owner = None
|
| 361 |
+
print("invite call failed:", type(err).__name__, re.sub(r"hf_\w+", "hf_***", str(err))[:400], flush=True)
|
| 362 |
raise gr.Error(t["invite_spent"] if "quota" in str(err).lower() else t["invite_down"]) from None
|
| 363 |
|
| 364 |
|