Jakubrd4's picture
Upload variant_a/logs/watchdog.sh with huggingface_hub
9bc1800 verified
#!/bin/bash
while true; do
if ! ps aux | grep -v grep | grep -q eval_polish; then
echo "EVAL DONE at $(date)" >> /workspace/eval_status.txt
cp -r /dev/shm/eval/results_remaining/ /workspace/results_remaining/
cp -r /dev/shm/eval/results_mc/ /workspace/results_mc/
cp -r /dev/shm/eval/results_gen/ /workspace/results_gen/
cd /workspace && pip install huggingface_hub -q
python3 -c "
from huggingface_hub import HfApi
api = HfApi(token='HF_TOKEN_REDACTED')
api.create_repo('Jakubrd4/bielik-q2-sharp-docs', private=True, exist_ok=True)
api.upload_folder(folder_path='/workspace/results_mc', path_in_repo='variant_a/results_mc', repo_id='Jakubrd4/bielik-q2-sharp-docs')
api.upload_folder(folder_path='/workspace/results_gen', path_in_repo='variant_a/results_gen', repo_id='Jakubrd4/bielik-q2-sharp-docs')
api.upload_folder(folder_path='/workspace/results_remaining', path_in_repo='variant_a/results_remaining', repo_id='Jakubrd4/bielik-q2-sharp-docs')
"
echo "UPLOADED at $(date)" >> /workspace/eval_status.txt
break
fi
sleep 300
done