diff --git a/tests/workers/critic/test_special_dp_critic.py b/tests/workers/critic/test_special_dp_critic.py index 636f8adda12..d6eaa10cf17 100644 --- a/tests/workers/critic/test_special_dp_critic.py +++ b/tests/workers/critic/test_special_dp_critic.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +import os import tempfile import unittest from unittest.mock import Mock, patch @@ -60,7 +60,8 @@ def setUp(self): self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") self.temp_dir = tempfile.mkdtemp() - config = AutoConfig.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") + model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct") + config = AutoConfig.from_pretrained(model_path) config.save_pretrained(self.temp_dir) self.config = FSDPCriticConfig( @@ -76,8 +77,8 @@ def setUp(self): rollout_n=1, optim=FSDPOptimizerConfig(lr=1e-6), model=FSDPCriticModelCfg( - path="Qwen/Qwen2.5-0.5B-Instruct", - tokenizer_path="Qwen/Qwen2.5-0.5B-Instruct", + path=model_path, + tokenizer_path=model_path, fsdp_config=FSDPEngineConfig(fsdp_size=-1), use_remove_padding=False, ), diff --git a/tests/workers/test_fsdp_workers.py b/tests/workers/test_fsdp_workers.py index e8b2eaf6b25..33f1b8e4130 100644 --- a/tests/workers/test_fsdp_workers.py +++ b/tests/workers/test_fsdp_workers.py @@ -25,9 +25,11 @@ def test_actor_rollout_ref_worker_actor_ref_model(): os.environ["MASTER_ADDR"] = "127.0.0.1" os.environ["MASTER_PORT"] = "8888" - config_str = """ + actor_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct") + ref_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-1.5B-Instruct") + config_str = f""" model: - path: Qwen/Qwen2.5-0.5B-Instruct + path: {actor_model_path} actor: _target_: verl.workers.config.FSDPActorConfig strategy: fsdp @@ -45,7 +47,7 @@ def test_actor_rollout_ref_worker_actor_ref_model(): stack_depth: 32 ref: model: - path: Qwen/Qwen2.5-1.5B-Instruct + path: {ref_model_path} fsdp_config: _target_: verl.workers.config.FSDPEngineConfig fsdp_size: -1