Skip to content

Commit

Permalink
Merge branch 'hn-set-model-eval-mode' into 'main'
Browse files Browse the repository at this point in the history
Add model.eval() to run_text_generation_server.py

See merge request ADLR/megatron-lm!2148
  • Loading branch information
jaredcasper committed Sep 25, 2024
2 parents 78bef1c + 5aceacb commit 4158084
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/run_text_generation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def add_text_generate_args(parser):

assert len(model) == 1, "Above condition should have caught this"
model = model[0]
model.eval()

if mpu.is_pipeline_first_stage() and mpu.get_tensor_model_parallel_rank() == 0:
server = MegatronServer(model)
server.run("0.0.0.0",port=args.port)
Expand Down

0 comments on commit 4158084

Please sign in to comment.