Commit
·
cef7c8f
1
Parent(s):
a51385c
Update submission file parsing to use custom delimiter and adjust upload path
Browse files- gradio_interface.py +2 -2
gradio_interface.py
CHANGED
@@ -113,7 +113,7 @@ def add_submission(file):
|
|
113 |
data = json.load(f)
|
114 |
|
115 |
username, sub_timestamp, task = file.replace(
|
116 |
-
".json", "").split("
|
117 |
submission_time = datetime.fromtimestamp(
|
118 |
sub_timestamp / 1000, tz=timezone.utc)
|
119 |
assert task in ["task1", "task2"], "Invalid task type"
|
@@ -122,7 +122,7 @@ def add_submission(file):
|
|
122 |
print("Adding submission...", username, task, submission_time)
|
123 |
upload_file(
|
124 |
path_or_fileobj=file,
|
125 |
-
path_in_repo=task+"/"+file.split("
|
126 |
repo_id=SUBMISSION_REPO
|
127 |
)
|
128 |
submissions.append(
|
|
|
113 |
data = json.load(f)
|
114 |
|
115 |
username, sub_timestamp, task = file.replace(
|
116 |
+
".json", "").split("-_-_-")
|
117 |
submission_time = datetime.fromtimestamp(
|
118 |
sub_timestamp / 1000, tz=timezone.utc)
|
119 |
assert task in ["task1", "task2"], "Invalid task type"
|
|
|
122 |
print("Adding submission...", username, task, submission_time)
|
123 |
upload_file(
|
124 |
path_or_fileobj=file,
|
125 |
+
path_in_repo=task+"/"+file.split("/")[-1],
|
126 |
repo_id=SUBMISSION_REPO
|
127 |
)
|
128 |
submissions.append(
|