Skip to content

Commit

Permalink
chore: add more logging (FLock-io#2)
Browse files Browse the repository at this point in the history
* chore: add more logging

* fix: change hg_repo_id to a variable
  • Loading branch information
nickcom007 authored May 14, 2024
1 parent 5b6d9ef commit 01e1eb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion full_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ def submit_task(task_id: int, hg_repo_id: str):
headers=headers,
data=payload,
)
if response.status_code != 200:
raise Exception(f"Failed to submit task: {response.text}")
return response.json()


if __name__ == "__main__":
task_id = os.environ["TASK_ID"]
task = get_task(task_id)
# log the task info
print(json.dumps(task, indent=4))
# download data from a presigned url
data_url = task["data"]["training_set_url"]
context_length = task["data"]["context_length"]
Expand Down Expand Up @@ -77,5 +81,5 @@ def submit_task(task_id: int, hg_repo_id: str):
repo_id=hg_repo_id, use_temp_dir=True, token=os.environ["HF_TOKEN"]
)
# submit
submit_task(task_id, f"{HG_USERNAME}/hg_repo_id")
submit_task(task_id, f"{HG_USERNAME}/{hg_repo_id}")
print("Task submitted successfully")

0 comments on commit 01e1eb0

Please sign in to comment.