Abhishek Thakur
commited on
Commit
·
2a67404
1
Parent(s):
156ba7d
push more files
Browse files- competitions/app.py +2 -1
- competitions/cli/create.py +32 -0
competitions/app.py
CHANGED
|
@@ -97,7 +97,6 @@ async def get_leaderboard(request: Request, lb: str):
|
|
| 97 |
eval_higher_is_better=COMP_INFO.eval_higher_is_better,
|
| 98 |
max_selected_submissions=COMP_INFO.selection_limit,
|
| 99 |
competition_id=COMPETITION_ID,
|
| 100 |
-
hardware=COMP_INFO.hardware,
|
| 101 |
token=HF_TOKEN,
|
| 102 |
)
|
| 103 |
if lb == "private":
|
|
@@ -118,6 +117,7 @@ async def my_submissions(request: Request, user: User):
|
|
| 118 |
competition_id=COMPETITION_ID,
|
| 119 |
token=HF_TOKEN,
|
| 120 |
competition_type=COMP_INFO.competition_type,
|
|
|
|
| 121 |
)
|
| 122 |
try:
|
| 123 |
success_subs, failed_subs = sub.my_submissions(user.user_token)
|
|
@@ -158,6 +158,7 @@ async def new_submission(
|
|
| 158 |
competition_id=COMPETITION_ID,
|
| 159 |
token=HF_TOKEN,
|
| 160 |
competition_type=COMP_INFO.competition_type,
|
|
|
|
| 161 |
)
|
| 162 |
try:
|
| 163 |
if COMP_INFO.competition_type == "generic":
|
|
|
|
| 97 |
eval_higher_is_better=COMP_INFO.eval_higher_is_better,
|
| 98 |
max_selected_submissions=COMP_INFO.selection_limit,
|
| 99 |
competition_id=COMPETITION_ID,
|
|
|
|
| 100 |
token=HF_TOKEN,
|
| 101 |
)
|
| 102 |
if lb == "private":
|
|
|
|
| 117 |
competition_id=COMPETITION_ID,
|
| 118 |
token=HF_TOKEN,
|
| 119 |
competition_type=COMP_INFO.competition_type,
|
| 120 |
+
hardware=COMP_INFO.hardware,
|
| 121 |
)
|
| 122 |
try:
|
| 123 |
success_subs, failed_subs = sub.my_submissions(user.user_token)
|
|
|
|
| 158 |
competition_id=COMPETITION_ID,
|
| 159 |
token=HF_TOKEN,
|
| 160 |
competition_type=COMP_INFO.competition_type,
|
| 161 |
+
hardware=COMP_INFO.hardware,
|
| 162 |
)
|
| 163 |
try:
|
| 164 |
if COMP_INFO.competition_type == "generic":
|
competitions/cli/create.py
CHANGED
|
@@ -229,6 +229,38 @@ class CreateCompetitionAppCommand(BaseCompetitionsCommand):
|
|
| 229 |
repo_type="dataset",
|
| 230 |
)
|
| 231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
# create competition space
|
| 233 |
api.create_repo(
|
| 234 |
repo_id=f"{competition_org}/{competition_name}",
|
|
|
|
| 229 |
repo_type="dataset",
|
| 230 |
)
|
| 231 |
|
| 232 |
+
comp_desc = io.BytesIO(COMPETITION_DESC.encode())
|
| 233 |
+
api.upload_file(
|
| 234 |
+
path_or_fileobj=comp_desc,
|
| 235 |
+
path_in_repo="COMPETITION_DESC.md",
|
| 236 |
+
repo_id=f"{competition_org}/{competition_name}",
|
| 237 |
+
repo_type="dataset",
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
dataset_desc = io.BytesIO(DATASET_DESC.encode())
|
| 241 |
+
api.upload_file(
|
| 242 |
+
path_or_fileobj=dataset_desc,
|
| 243 |
+
path_in_repo="DATASET_DESC.md",
|
| 244 |
+
repo_id=f"{competition_org}/{competition_name}",
|
| 245 |
+
repo_type="dataset",
|
| 246 |
+
)
|
| 247 |
+
|
| 248 |
+
submission_desc = io.BytesIO(SUBMISSION_DESC.encode())
|
| 249 |
+
api.upload_file(
|
| 250 |
+
path_or_fileobj=submission_desc,
|
| 251 |
+
path_in_repo="SUBMISSION_DESC.md",
|
| 252 |
+
repo_id=f"{competition_org}/{competition_name}",
|
| 253 |
+
repo_type="dataset",
|
| 254 |
+
)
|
| 255 |
+
|
| 256 |
+
solution_csv = io.BytesIO(SOLUTION_CSV.encode())
|
| 257 |
+
api.upload_file(
|
| 258 |
+
path_or_fileobj=solution_csv,
|
| 259 |
+
path_in_repo="solution.csv",
|
| 260 |
+
repo_id=f"{competition_org}/{competition_name}",
|
| 261 |
+
repo_type="dataset",
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
# create competition space
|
| 265 |
api.create_repo(
|
| 266 |
repo_id=f"{competition_org}/{competition_name}",
|