From 9d1a981abd6d0b5b094b93ffa44e714bd1c5a1cf Mon Sep 17 00:00:00 2001 From: Ligeng Zhu Date: Tue, 11 Mar 2025 22:31:09 +0800 Subject: [PATCH 1/2] Update setup.sh --- setup.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index adcde953..c4b565fe 100644 --- a/setup.sh +++ b/setup.sh @@ -1,15 +1,17 @@ # Install the packages in r1-v . cd src/r1-v -pip install -e ".[dev]" +pip install uv pip --upgrade + +uv pip install -e ".[dev]" # Addtional modules -pip install wandb==0.18.3 -pip install tensorboardx -pip install qwen_vl_utils torchvision -pip install flash-attn --no-build-isolation +uv pip install wandb==0.18.3 +uv pip install tensorboardx +uv pip install qwen_vl_utils torchvision +uv pip install flash-attn --no-build-isolation # vLLM support -pip install vllm==0.7.2 +uv pip install vllm==0.7.2 # fix transformers version -pip install git+https://github.com/huggingface/transformers.git@336dc69d63d56f232a183a3e7f52790429b871ef \ No newline at end of file +uv pip install git+https://github.com/huggingface/transformers.git@336dc69d63d56f232a183a3e7f52790429b871ef From a7c9d187c391fade2aa595dd3d308104e35b27fe Mon Sep 17 00:00:00 2001 From: Ligeng Zhu Date: Tue, 11 Mar 2025 22:32:29 +0800 Subject: [PATCH 2/2] Update grpo.py --- src/r1-v/src/open_r1/grpo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r1-v/src/open_r1/grpo.py b/src/r1-v/src/open_r1/grpo.py index 80accd15..d97e84a1 100644 --- a/src/r1-v/src/open_r1/grpo.py +++ b/src/r1-v/src/open_r1/grpo.py @@ -86,7 +86,7 @@ def accuracy_reward(completions, solution, **kwargs): if os.getenv("DEBUG_MODE") == "true": log_path = os.getenv("LOG_PATH") # local_rank = int(os.getenv("LOCAL_RANK", 0)) - with open(log_path, "a") as f: + with open(log_path, "a", encoding="utf-8") as f: f.write(f"------------- {current_time} Accuracy reward: {reward} -------------\n") f.write(f"Content: {content}\n") f.write(f"Solution: {sol}\n")