Skip to content

Commit e5243f5

Browse files
authored
[ci] fix: use local hf model path (verl-project#4299)
### What does this PR do? As title
1 parent c651b7b commit e5243f5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/workers/critic/test_special_dp_critic.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
15+
import os
1616
import tempfile
1717
import unittest
1818
from unittest.mock import Mock, patch
@@ -60,7 +60,8 @@ def setUp(self):
6060
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
6161
self.temp_dir = tempfile.mkdtemp()
6262

63-
config = AutoConfig.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
63+
model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct")
64+
config = AutoConfig.from_pretrained(model_path)
6465
config.save_pretrained(self.temp_dir)
6566

6667
self.config = FSDPCriticConfig(
@@ -76,8 +77,8 @@ def setUp(self):
7677
rollout_n=1,
7778
optim=FSDPOptimizerConfig(lr=1e-6),
7879
model=FSDPCriticModelCfg(
79-
path="Qwen/Qwen2.5-0.5B-Instruct",
80-
tokenizer_path="Qwen/Qwen2.5-0.5B-Instruct",
80+
path=model_path,
81+
tokenizer_path=model_path,
8182
fsdp_config=FSDPEngineConfig(fsdp_size=-1),
8283
use_remove_padding=False,
8384
),

tests/workers/test_fsdp_workers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def test_actor_rollout_ref_worker_actor_ref_model():
2525
os.environ["MASTER_ADDR"] = "127.0.0.1"
2626
os.environ["MASTER_PORT"] = "8888"
2727

28-
config_str = """
28+
actor_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-0.5B-Instruct")
29+
ref_model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-1.5B-Instruct")
30+
config_str = f"""
2931
model:
30-
path: Qwen/Qwen2.5-0.5B-Instruct
32+
path: {actor_model_path}
3133
actor:
3234
_target_: verl.workers.config.FSDPActorConfig
3335
strategy: fsdp
@@ -45,7 +47,7 @@ def test_actor_rollout_ref_worker_actor_ref_model():
4547
stack_depth: 32
4648
ref:
4749
model:
48-
path: Qwen/Qwen2.5-1.5B-Instruct
50+
path: {ref_model_path}
4951
fsdp_config:
5052
_target_: verl.workers.config.FSDPEngineConfig
5153
fsdp_size: -1

0 commit comments

Comments
 (0)