Spaces:
Runtime error
Runtime error
Maharshi Gor
commited on
Commit
·
8037dc7
1
Parent(s):
60ece04
Added environment packages and repo formatting configs
Browse files- .gitignore +13 -0
- app.py +3 -9
- formatting.py +1 -3
- pyproject.toml +57 -0
- requirements.txt +4 -0
.gitignore
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
registered-users/
|
| 2 |
+
.DS_Store
|
| 3 |
+
.env
|
| 4 |
+
.venv
|
| 5 |
+
.idea
|
| 6 |
+
.vscode
|
| 7 |
+
|
| 8 |
+
__pycache__/
|
| 9 |
+
*.pyc
|
| 10 |
+
*.pyo
|
| 11 |
+
*.pyd
|
| 12 |
+
*.pyw
|
| 13 |
+
*.pyz
|
app.py
CHANGED
|
@@ -99,9 +99,7 @@ def download_dataset_snapshot(repo_id, local_dir):
|
|
| 99 |
tqdm_class=None,
|
| 100 |
)
|
| 101 |
except Exception as e:
|
| 102 |
-
logger.error(
|
| 103 |
-
f"Error downloading dataset snapshot from {repo_id} to {local_dir}: {e}. Restarting space."
|
| 104 |
-
)
|
| 105 |
API.restart_space(repo_id=repo_id)
|
| 106 |
|
| 107 |
|
|
@@ -180,9 +178,7 @@ def user_signup(
|
|
| 180 |
Sign up for the competition.
|
| 181 |
"""
|
| 182 |
if profile is None:
|
| 183 |
-
return styled_error(
|
| 184 |
-
"Please sign in using your HuggingFace account to register for the competition."
|
| 185 |
-
)
|
| 186 |
try:
|
| 187 |
username = profile.username
|
| 188 |
user = get_user(username)
|
|
@@ -250,9 +246,7 @@ def load_user_info(profile: gr.OAuthProfile | None):
|
|
| 250 |
)
|
| 251 |
|
| 252 |
|
| 253 |
-
with gr.Blocks(
|
| 254 |
-
title="Register - QANTA 2025 Quizbowl System Submission", css=css
|
| 255 |
-
) as demo:
|
| 256 |
gr.Markdown("# Register for QANTA 2025 Quizbowl System Submission")
|
| 257 |
with gr.Row():
|
| 258 |
with gr.Column():
|
|
|
|
| 99 |
tqdm_class=None,
|
| 100 |
)
|
| 101 |
except Exception as e:
|
| 102 |
+
logger.error(f"Error downloading dataset snapshot from {repo_id} to {local_dir}: {e}. Restarting space.")
|
|
|
|
|
|
|
| 103 |
API.restart_space(repo_id=repo_id)
|
| 104 |
|
| 105 |
|
|
|
|
| 178 |
Sign up for the competition.
|
| 179 |
"""
|
| 180 |
if profile is None:
|
| 181 |
+
return styled_error("Please sign in using your HuggingFace account to register for the competition.")
|
|
|
|
|
|
|
| 182 |
try:
|
| 183 |
username = profile.username
|
| 184 |
user = get_user(username)
|
|
|
|
| 246 |
)
|
| 247 |
|
| 248 |
|
| 249 |
+
with gr.Blocks(title="Register - QANTA 2025 Quizbowl System Submission", css=css) as demo:
|
|
|
|
|
|
|
| 250 |
gr.Markdown("# Register for QANTA 2025 Quizbowl System Submission")
|
| 251 |
with gr.Row():
|
| 252 |
with gr.Column():
|
formatting.py
CHANGED
|
@@ -20,9 +20,7 @@ def tiny_styled_warning(warn):
|
|
| 20 |
|
| 21 |
|
| 22 |
def styled_message(message):
|
| 23 |
-
return
|
| 24 |
-
f"<p style='color: green; font-size: 20px; text-align: center;'>{message}</p>"
|
| 25 |
-
)
|
| 26 |
|
| 27 |
|
| 28 |
def has_no_nan_values(df, columns):
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
def styled_message(message):
|
| 23 |
+
return f"<p style='color: green; font-size: 20px; text-align: center;'>{message}</p>"
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def has_no_nan_values(df, columns):
|
pyproject.toml
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[tool.ruff]
|
| 2 |
+
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
| 3 |
+
select = ["E", "F"]
|
| 4 |
+
ignore = ["E501"] # line too long (black is taking care of this)
|
| 5 |
+
line-length = 119
|
| 6 |
+
fixable = [
|
| 7 |
+
"A",
|
| 8 |
+
"B",
|
| 9 |
+
"C",
|
| 10 |
+
"D",
|
| 11 |
+
"E",
|
| 12 |
+
"F",
|
| 13 |
+
"G",
|
| 14 |
+
"I",
|
| 15 |
+
"N",
|
| 16 |
+
"Q",
|
| 17 |
+
"S",
|
| 18 |
+
"T",
|
| 19 |
+
"W",
|
| 20 |
+
"ANN",
|
| 21 |
+
"ARG",
|
| 22 |
+
"BLE",
|
| 23 |
+
"COM",
|
| 24 |
+
"DJ",
|
| 25 |
+
"DTZ",
|
| 26 |
+
"EM",
|
| 27 |
+
"ERA",
|
| 28 |
+
"EXE",
|
| 29 |
+
"FBT",
|
| 30 |
+
"ICN",
|
| 31 |
+
"INP",
|
| 32 |
+
"ISC",
|
| 33 |
+
"NPY",
|
| 34 |
+
"PD",
|
| 35 |
+
"PGH",
|
| 36 |
+
"PIE",
|
| 37 |
+
"PL",
|
| 38 |
+
"PT",
|
| 39 |
+
"PTH",
|
| 40 |
+
"PYI",
|
| 41 |
+
"RET",
|
| 42 |
+
"RSE",
|
| 43 |
+
"RUF",
|
| 44 |
+
"SIM",
|
| 45 |
+
"SLF",
|
| 46 |
+
"TID",
|
| 47 |
+
"TRY",
|
| 48 |
+
"UP",
|
| 49 |
+
"YTT",
|
| 50 |
+
]
|
| 51 |
+
|
| 52 |
+
[tool.isort]
|
| 53 |
+
profile = "black"
|
| 54 |
+
line_length = 119
|
| 55 |
+
|
| 56 |
+
[tool.black]
|
| 57 |
+
line-length = 119
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
loguru
|
| 2 |
+
gradio[oauth]
|
| 3 |
+
pydantic
|
| 4 |
+
huggingface-hub
|