Spaces:
Sleeping
Sleeping
Youngsun Lim
commited on
Commit
Β·
dbf2b77
1
Parent(s):
dd0ec9d
saving csv directory change
Browse files
app.py
CHANGED
|
@@ -150,7 +150,7 @@ REWARD_FILE = "reward_codes.csv" # 리μλ μ½λ κΈ°λ‘μ© νμΌ (HF datas
|
|
| 150 |
def _read_codes_bytes():
|
| 151 |
try:
|
| 152 |
p = hf_hub_download(
|
| 153 |
-
repo_id=
|
| 154 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 155 |
)
|
| 156 |
return open(p, "rb").read()
|
|
@@ -176,7 +176,7 @@ def _persist_reward_code(pid: str, code: str, total_done: int):
|
|
| 176 |
api.upload_file(
|
| 177 |
path_or_fileobj=io.BytesIO(newb),
|
| 178 |
path_in_repo=REWARD_FILE,
|
| 179 |
-
repo_id=
|
| 180 |
repo_type="dataset",
|
| 181 |
token=HF_TOKEN,
|
| 182 |
commit_message="append reward code"
|
|
@@ -230,7 +230,7 @@ FEEDBACK_FILE = "final_feedback.csv"
|
|
| 230 |
def _read_feedback_bytes():
|
| 231 |
try:
|
| 232 |
p = hf_hub_download(
|
| 233 |
-
repo_id=
|
| 234 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 235 |
)
|
| 236 |
return open(p, "rb").read()
|
|
@@ -269,7 +269,7 @@ def push_final_feedback(participant_id: str, comment: str):
|
|
| 269 |
api.upload_file(
|
| 270 |
path_or_fileobj=io.BytesIO(newb),
|
| 271 |
path_in_repo=FEEDBACK_FILE,
|
| 272 |
-
repo_id=
|
| 273 |
repo_type="dataset",
|
| 274 |
token=HF_TOKEN,
|
| 275 |
commit_message="append final feedback"
|
|
@@ -285,6 +285,8 @@ def push_final_feedback(participant_id: str, comment: str):
|
|
| 285 |
# -------------------- Config --------------------
|
| 286 |
# REPO_ID = os.getenv("RESULTS_REPO", "dghadiya/video_eval") # μ
λ‘λν 리ν¬μ μΌμΉ
|
| 287 |
REPO_ID = os.getenv("RESULTS_REPO", "dghadiya/video_examples")
|
|
|
|
|
|
|
| 288 |
REPO_TYPE = "dataset"
|
| 289 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 290 |
RESULTS_FILE = "results.csv"
|
|
@@ -369,7 +371,7 @@ def _get_video_id(v: dict) -> str:
|
|
| 369 |
def _read_csv_bytes():
|
| 370 |
try:
|
| 371 |
p = hf_hub_download(
|
| 372 |
-
repo_id=
|
| 373 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 374 |
)
|
| 375 |
return open(p, "rb").read()
|
|
@@ -465,7 +467,7 @@ def push(participant_id, video_id, action_score, phys_score, notes=""):
|
|
| 465 |
api.upload_file(
|
| 466 |
path_or_fileobj=io.BytesIO(newb),
|
| 467 |
path_in_repo=RESULTS_FILE,
|
| 468 |
-
repo_id=
|
| 469 |
repo_type="dataset",
|
| 470 |
token=HF_TOKEN,
|
| 471 |
commit_message="append"
|
|
|
|
| 150 |
def _read_codes_bytes():
|
| 151 |
try:
|
| 152 |
p = hf_hub_download(
|
| 153 |
+
repo_id=RESULTS_REPO_ID, filename=REWARD_FILE, repo_type="dataset",
|
| 154 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 155 |
)
|
| 156 |
return open(p, "rb").read()
|
|
|
|
| 176 |
api.upload_file(
|
| 177 |
path_or_fileobj=io.BytesIO(newb),
|
| 178 |
path_in_repo=REWARD_FILE,
|
| 179 |
+
repo_id=RESULTS_REPO_ID,
|
| 180 |
repo_type="dataset",
|
| 181 |
token=HF_TOKEN,
|
| 182 |
commit_message="append reward code"
|
|
|
|
| 230 |
def _read_feedback_bytes():
|
| 231 |
try:
|
| 232 |
p = hf_hub_download(
|
| 233 |
+
repo_id=RESULTS_REPO_ID, filename=FEEDBACK_FILE, repo_type="dataset",
|
| 234 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 235 |
)
|
| 236 |
return open(p, "rb").read()
|
|
|
|
| 269 |
api.upload_file(
|
| 270 |
path_or_fileobj=io.BytesIO(newb),
|
| 271 |
path_in_repo=FEEDBACK_FILE,
|
| 272 |
+
repo_id=RESULTS_REPO_ID,
|
| 273 |
repo_type="dataset",
|
| 274 |
token=HF_TOKEN,
|
| 275 |
commit_message="append final feedback"
|
|
|
|
| 285 |
# -------------------- Config --------------------
|
| 286 |
# REPO_ID = os.getenv("RESULTS_REPO", "dghadiya/video_eval") # μ
λ‘λν 리ν¬μ μΌμΉ
|
| 287 |
REPO_ID = os.getenv("RESULTS_REPO", "dghadiya/video_examples")
|
| 288 |
+
RESULTS_REPO_ID = "dghadiya/video_eval" # <- λ€κ° μνλ μ΅μ’
μ μ₯ μμΉ
|
| 289 |
+
|
| 290 |
REPO_TYPE = "dataset"
|
| 291 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 292 |
RESULTS_FILE = "results.csv"
|
|
|
|
| 371 |
def _read_csv_bytes():
|
| 372 |
try:
|
| 373 |
p = hf_hub_download(
|
| 374 |
+
repo_id=RESULTS_REPO_ID, filename=RESULTS_FILE, repo_type="dataset",
|
| 375 |
token=HF_TOKEN, local_dir="/tmp", local_dir_use_symlinks=False
|
| 376 |
)
|
| 377 |
return open(p, "rb").read()
|
|
|
|
| 467 |
api.upload_file(
|
| 468 |
path_or_fileobj=io.BytesIO(newb),
|
| 469 |
path_in_repo=RESULTS_FILE,
|
| 470 |
+
repo_id=RESULTS_REPO_ID,
|
| 471 |
repo_type="dataset",
|
| 472 |
token=HF_TOKEN,
|
| 473 |
commit_message="append"
|