Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
c1be18e
1
Parent(s):
e392b76
sentry fix
Browse files
app.py
CHANGED
|
@@ -1,4 +1,21 @@
|
|
| 1 |
import uuid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
|
@@ -10,10 +27,6 @@ import sys
|
|
| 10 |
from datetime import datetime
|
| 11 |
import re
|
| 12 |
from PIL import Image
|
| 13 |
-
import os, logging
|
| 14 |
-
import sentry_sdk
|
| 15 |
-
from sentry_sdk import capture_exception
|
| 16 |
-
from sentry_sdk.integrations.logging import LoggingIntegration
|
| 17 |
|
| 18 |
# --- Configuration ---
|
| 19 |
#AUTFORGE_SCRIPT_PATH = "auto_forge.py" # Make sure this points to your script
|
|
@@ -29,18 +42,7 @@ DISPLAY_COL_MAP = {
|
|
| 29 |
" Color": "Color (Hex)",
|
| 30 |
}
|
| 31 |
|
| 32 |
-
|
| 33 |
-
dsn=os.getenv("SENTRY_DSN"),
|
| 34 |
-
traces_sample_rate=0.1, # performance traces, optional
|
| 35 |
-
integrations=[
|
| 36 |
-
LoggingIntegration(
|
| 37 |
-
level=logging.INFO, # capture warnings/info in breadcrumbs
|
| 38 |
-
event_level=logging.ERROR,
|
| 39 |
-
),
|
| 40 |
-
],
|
| 41 |
-
release=os.getenv("HF_SPACE_VERSION", "dev"),
|
| 42 |
-
environment="hf_space",
|
| 43 |
-
)
|
| 44 |
|
| 45 |
|
| 46 |
def ensure_required_cols(df, *, in_display_space):
|
|
|
|
| 1 |
import uuid
|
| 2 |
+
import os, logging
|
| 3 |
+
import sentry_sdk
|
| 4 |
+
from sentry_sdk import capture_exception
|
| 5 |
+
from sentry_sdk.integrations.logging import LoggingIntegration
|
| 6 |
+
|
| 7 |
+
sentry_sdk.init(
|
| 8 |
+
dsn=os.getenv("SENTRY_DSN"),
|
| 9 |
+
traces_sample_rate=0.1, # performance traces, optional
|
| 10 |
+
integrations=[
|
| 11 |
+
LoggingIntegration(
|
| 12 |
+
level=logging.INFO, # capture warnings/info in breadcrumbs
|
| 13 |
+
event_level=logging.ERROR,
|
| 14 |
+
),
|
| 15 |
+
],
|
| 16 |
+
release=os.getenv("HF_SPACE_VERSION", "dev"),
|
| 17 |
+
environment="hf_space",
|
| 18 |
+
)
|
| 19 |
|
| 20 |
import gradio as gr
|
| 21 |
import pandas as pd
|
|
|
|
| 27 |
from datetime import datetime
|
| 28 |
import re
|
| 29 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# --- Configuration ---
|
| 32 |
#AUTFORGE_SCRIPT_PATH = "auto_forge.py" # Make sure this points to your script
|
|
|
|
| 42 |
" Color": "Color (Hex)",
|
| 43 |
}
|
| 44 |
|
| 45 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
def ensure_required_cols(df, *, in_display_space):
|