Commit
·
afba419
1
Parent(s):
62b6599
Writing to specific username path
Browse files
submit.py
CHANGED
@@ -5,7 +5,7 @@ import json
|
|
5 |
|
6 |
from click import pass_obj
|
7 |
import gradio as gr
|
8 |
-
from datetime import datetime
|
9 |
import uuid
|
10 |
|
11 |
from constants import API, SUBMISSIONS_REPO
|
@@ -19,7 +19,8 @@ def upload_submission(
|
|
19 |
model_name: str,
|
20 |
model_description: str,
|
21 |
):
|
22 |
-
timestamp = datetime.
|
|
|
23 |
submission_id = str(uuid.uuid4())
|
24 |
|
25 |
with file_path.open("rb") as f_in:
|
@@ -28,7 +29,7 @@ def upload_submission(
|
|
28 |
validate_csv_file(file_content, submission_type)
|
29 |
|
30 |
# write to dataset
|
31 |
-
filename = f"{submission_id}.json"
|
32 |
# Note: This may be represented as Parquet in the future, so the schema needs to stay consistent
|
33 |
record = {
|
34 |
"submission_id": submission_id,
|
|
|
5 |
|
6 |
from click import pass_obj
|
7 |
import gradio as gr
|
8 |
+
from datetime import datetime, UTC
|
9 |
import uuid
|
10 |
|
11 |
from constants import API, SUBMISSIONS_REPO
|
|
|
19 |
model_name: str,
|
20 |
model_description: str,
|
21 |
):
|
22 |
+
timestamp = datetime.now(UTC).isoformat()
|
23 |
+
date = datetime.now(UTC).date().isoformat()
|
24 |
submission_id = str(uuid.uuid4())
|
25 |
|
26 |
with file_path.open("rb") as f_in:
|
|
|
29 |
validate_csv_file(file_content, submission_type)
|
30 |
|
31 |
# write to dataset
|
32 |
+
filename = f"{user_state}/{date}_{model_name}_{submission_id}.json" # Writing to a bit more structured name
|
33 |
# Note: This may be represented as Parquet in the future, so the schema needs to stay consistent
|
34 |
record = {
|
35 |
"submission_id": submission_id,
|