Instructions to use hchen657Naza/PWM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hchen657Naza/PWM with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hchen657Naza/PWM", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Download PWM_code/policy_wm_eval/run_server.sh from hchen657Naza/PWM: direct link, hf CLI and curl.
- Browser
- Download file 995 Bytes
-
https://huggingface.co/hchen657Naza/PWM/resolve/main/PWM_code/policy_wm_eval/run_server.sh
- Command line
-
hf download hf://hchen657Naza/PWM/PWM_code/policy_wm_eval/run_server.sh
-
curl -L -o run_server.sh https://huggingface.co/hchen657Naza/PWM/resolve/main/PWM_code/policy_wm_eval/run_server.sh
995 Bytes
| # Launch an OSCAR WM HTTP server for the eval. | |
| # LORA="finetune/ckpt_6task_lora25/lora_step16000.pt" # finetuned chunk25 skeleton WM | |
| # LORA="" # base OSCAR-2B (no LoRA) | |
| # | |
| # Usage: | |
| # GPU=6 PORT=8819 MASTER_PORT=29618 \ | |
| # LORA=finetune/ckpt_6task_lora25/lora_step16000.pt bash run_server.sh | |
| set -euo pipefail | |
| OSCAR=/root/pwm_local/oscar-public | |
| GPU="${GPU:-6}" | |
| PORT="${PORT:-8819}" | |
| MASTER_PORT="${MASTER_PORT:-29618}" | |
| LORA="${LORA:-finetune/ckpt_6task_lora25/lora_step16000.pt}" | |
| LOG="${LOG:-/tmp/oscar_server_${PORT}.log}" | |
| cd "$OSCAR" | |
| CUDA_VISIBLE_DEVICES="$GPU" PYTHONPATH=. HF_HUB_OFFLINE=1 \ | |
| .venv/bin/torchrun --nproc_per_node=1 --master_port="$MASTER_PORT" \ | |
| /root/pwm_local/PWM_code/policy_rl/rl_sim/act_wm_residual_oscar/workers/wm/oscar_wm_server.py \ | |
| --lora "$LORA" --lora_r 16 --lora_alpha 32 --port "$PORT" > "$LOG" 2>&1 & | |
| echo "oscar server pid $! -> port $PORT gpu $GPU log $LOG (lora=${LORA:-BASE})" | |