function build() { module=$1 set -x docker build -f ./$module/Dockerfile -t $module . docker image tag $module ghcr.io/w32zhong/$module:latest set +x } function push() { module=$1 set -x docker push ghcr.io/w32zhong/$module:latest set +x } function build_and_push() { module=$1 build $module push $module } function build_and_push_all() { build_and_push s3d build_and_push medusa build_and_push eagle build_and_push sequoia build_and_push cllm build_and_push mcsd build_and_push selfspec build_and_push ouroboros } function cleanup() { docker container prune -f docker rmi $(docker images -f "dangling=true" -q) docker images } function docker_run() { set -x docker run \ --gpus 'device=0' --ipc=host --ulimit memlock=-1 \ -v $HOME/.cache:/root/.cache \ -v `pwd`/output:/workspace/s3d/output \ -v `pwd`/logs:/workspace/s3d/logs \ -it $DOCKER_IMG python $@ set +x } function test_s3d() { export DOCKER_IMG=s3d docker_run eval.py s3d \ --train_config_section full_finetune_layer526 \ --decode_config_section baseline \ --dataset human-eval --max_length 1900 \ --model_path w32zhong/s3d-full_finetune_layer526 \ --sample_range 0,1 --log_endpoint '/tmp' } function test_any() { method=$1 export DOCKER_IMG=$1 docker_run eval.py $method \ --dataset human-eval --max_length 1900 \ --sample_range 0,1 --log_endpoint '/tmp' }