MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / create_value_model

Function create_value_model

verl/tests/models/test_engine.py:234–246  ·  view source on GitHub ↗
(language_model_path, output_path)

Source from the content-addressed store, hash-verified

232
233
234def create_value_model(language_model_path, output_path):
235 config = AutoConfig.from_pretrained(language_model_path)
236 config.num_labels = 1
237 config.classifier_dropout = 0
238 config.tie_word_embeddings = False
239 model = AutoModelForTokenClassification.from_config(config)
240 tokenizer = AutoTokenizer.from_pretrained(os.path.expanduser(language_model_path))
241 assert model.config.num_labels == 1
242 path = os.path.expanduser(output_path)
243 model.save_pretrained(path)
244 tokenizer.save_pretrained(path)
245 config.save_pretrained(path)
246 return path
247
248
249@pytest.mark.parametrize("strategy", ["fsdp", "fsdp2"])

Callers 1

test_critic_engineFunction · 0.85

Calls 3

from_pretrainedMethod · 0.80
from_configMethod · 0.80
save_pretrainedMethod · 0.80

Tested by

no test coverage detected